mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-08-20 13:23:57 -07:00
Switched usleep to nanosleep for posix complience
This commit is contained in:
parent
62be0a4aad
commit
554d66c768
35 changed files with 70 additions and 47 deletions
19
hydra-time.c
Normal file
19
hydra-time.c
Normal file
|
@ -0,0 +1,19 @@
|
|||
|
||||
#include <time.h>
|
||||
|
||||
#include "hydra.h"
|
||||
|
||||
int sleepn(time_t seconds)
|
||||
{
|
||||
struct timespec ts;
|
||||
ts.tv_sec = seconds;
|
||||
ts.tv_nsec = 0;
|
||||
return nanosleep(&ts, NULL);
|
||||
}
|
||||
|
||||
int usleepn(long int milisec) {
|
||||
struct timespec ts;
|
||||
ts.tv_sec = milisec / 1000;
|
||||
ts.tv_nsec = (milisec % 1000) * 1000000L;
|
||||
return nanosleep(&ts, NULL);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue