Andrew Bettison
21328e2888
Improve read_whole_file()
...
Move into os.c, declare and document in os.h
2013-12-19 19:14:52 +10:30
Andrew Bettison
4428a76379
Use ssize_t for read(2) and write(2) return value
...
Test for errors using == -1 not < 0, and cast to (size_t) subsequently
Fixes some -Wsign-compare warnings
2013-12-10 17:21:35 +10:30
Andrew Bettison
5226e47ef6
Uniform #ifdef __SERVAL_DNA__... for headers
2013-12-04 17:15:36 +10:30
Andrew Bettison
1c8e01af9d
urandombytes() size_t instead of unsigned long long
2013-10-07 04:47:23 +10:30
Jeremy Lakeman
8fea1523b1
More consistent use of sleep_ms
2013-08-27 15:14:17 +09:30
gardners
8bd05b6f6d
fix type cast warning on OSX.
2013-07-19 20:04:15 +09:30
gardners
dc49671583
take sleep() out of urandomdev(), since it just causes problems, and
...
read() should block if there aren't bytes available yet.
2013-05-07 14:42:47 +09:30
gardners
243a26707e
reset urandomfd if it delivers an EBADF (seeing this on Mesh Extenders)
2013-05-07 13:52:19 +09:30
Andrew Bettison
65f6e88e67
Add emkdirs() and emkdirsn()
2013-04-04 17:37:49 +10:30
Andrew Bettison
5430b70640
Fix Android build with latest bcopy/bzero changes
2013-02-26 11:34:41 +10:30
Andrew Bettison
5518859b66
Refactor: move read_symlink() from log.c to os.c
2013-02-25 15:25:53 +10:30
Andrew Bettison
1e61e7a02f
Fix bcopy()/bzero() #define hack
...
Replace #define bcopy(...) memset(...) with inline functions only if
bcopy() is unavailable, as checked by configure script
Ditto bzero()
2013-02-25 15:23:03 +10:30
Andrew Bettison
d3c2205d44
Add os.c and "os.h", replacing mkdirs.c
...
The new header "os.h" defines a supplemental API around existing basic
operating system services (system calls and standard library functions).
Moved some function prototypes from serval.h and net.h into os.h.
This allows non-servald executables to take advantage of this API without
having to include serval.h and bringing in all the other servald link-time
baggage.
2012-12-04 10:12:35 +10:30