diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-09-14 16:14:42 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-09-14 16:14:42 +0000 |
commit | 946de21c805f2684d27ea7a4d7b6ae5a6337f925 (patch) | |
tree | 240d1551cadca44fe1e3fd760d25121f223cab31 /src/include/plibc.h | |
parent | 672f23ab910aa13a5a0f5e7f96f9786404ac447a (diff) | |
download | gnunet-946de21c805f2684d27ea7a4d7b6ae5a6337f925.tar.gz gnunet-946de21c805f2684d27ea7a4d7b6ae5a6337f925.zip |
-fix #3033
Diffstat (limited to 'src/include/plibc.h')
-rw-r--r-- | src/include/plibc.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/include/plibc.h b/src/include/plibc.h index d19037728..842edb66c 100644 --- a/src/include/plibc.h +++ b/src/include/plibc.h | |||
@@ -22,7 +22,7 @@ | |||
22 | * @brief PlibC header | 22 | * @brief PlibC header |
23 | * @attention This file is usually not installed under Unix, | 23 | * @attention This file is usually not installed under Unix, |
24 | * so ship it with your application | 24 | * so ship it with your application |
25 | * @version $Revision$ | 25 | * @version $Revision: 149 $ |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #ifndef _PLIBC_H_ | 28 | #ifndef _PLIBC_H_ |
@@ -115,6 +115,10 @@ enum | |||
115 | _SC_PAGE_SIZE = 30 | 115 | _SC_PAGE_SIZE = 30 |
116 | }; | 116 | }; |
117 | 117 | ||
118 | #if !defined(EACCESS) | ||
119 | # define EACCESS EACCES | ||
120 | #endif | ||
121 | |||
118 | /* Thanks to the Cygwin project */ | 122 | /* Thanks to the Cygwin project */ |
119 | #if !defined(ENOCSI) | 123 | #if !defined(ENOCSI) |
120 | # define ENOCSI 43 /* No CSI structure available */ | 124 | # define ENOCSI 43 /* No CSI structure available */ |
@@ -521,9 +525,6 @@ int inet_pton4(const char *src, u_char *dst, int pton); | |||
521 | #if USE_IPV6 | 525 | #if USE_IPV6 |
522 | int inet_pton6(const char *src, u_char *dst); | 526 | int inet_pton6(const char *src, u_char *dst); |
523 | #endif | 527 | #endif |
524 | #if !defined(FTRUNCATE_DEFINED) | ||
525 | int truncate(const char *fname, int distance); | ||
526 | #endif | ||
527 | int statfs(const char *path, struct statfs *buf); | 528 | int statfs(const char *path, struct statfs *buf); |
528 | const char *hstrerror(int err); | 529 | const char *hstrerror(int err); |
529 | int mkstemp(char *tmplate); | 530 | int mkstemp(char *tmplate); |
@@ -557,8 +558,9 @@ int _win_close(int fd); | |||
557 | int _win_creat(const char *path, mode_t mode); | 558 | int _win_creat(const char *path, mode_t mode); |
558 | char *_win_ctime(const time_t *clock); | 559 | char *_win_ctime(const time_t *clock); |
559 | char *_win_ctime_r(const time_t *clock, char *buf); | 560 | char *_win_ctime_r(const time_t *clock, char *buf); |
560 | int _win_fstat(int handle, struct stat *buffer); | 561 | int _win_fstat(int handle, struct _stat *buffer); |
561 | int _win_ftruncate(int fildes, off_t length); | 562 | int _win_ftruncate(int fildes, off_t length); |
563 | int _win_truncate(const char *fname, int distance); | ||
562 | int _win_kill(pid_t pid, int sig); | 564 | int _win_kill(pid_t pid, int sig); |
563 | int _win_pipe(int *phandles); | 565 | int _win_pipe(int *phandles); |
564 | intptr_t _win_mkfifo(const char *path, mode_t mode); | 566 | intptr_t _win_mkfifo(const char *path, mode_t mode); |
@@ -570,7 +572,7 @@ long _win_random(void); | |||
570 | void _win_srandom(unsigned int seed); | 572 | void _win_srandom(unsigned int seed); |
571 | int _win_remove(const char *path); | 573 | int _win_remove(const char *path); |
572 | int _win_rename(const char *oldname, const char *newname); | 574 | int _win_rename(const char *oldname, const char *newname); |
573 | int _win_stat(const char *path, struct stat *buffer); | 575 | int _win_stat(const char *path, struct _stat *buffer); |
574 | int _win_stat64(const char *path, struct stat64 *buffer); | 576 | int _win_stat64(const char *path, struct stat64 *buffer); |
575 | long _win_sysconf(int name); | 577 | long _win_sysconf(int name); |
576 | int _win_unlink(const char *filename); | 578 | int _win_unlink(const char *filename); |
@@ -583,7 +585,7 @@ void *_win_mmap(void *start, size_t len, int access, int flags, int fd, | |||
583 | unsigned long long offset); | 585 | unsigned long long offset); |
584 | int _win_msync(void *start, size_t length, int flags); | 586 | int _win_msync(void *start, size_t length, int flags); |
585 | int _win_munmap(void *start, size_t length); | 587 | int _win_munmap(void *start, size_t length); |
586 | int _win_lstat(const char *path, struct stat *buf); | 588 | int _win_lstat(const char *path, struct _stat *buf); |
587 | int _win_lstat64(const char *path, struct stat64 *buf); | 589 | int _win_lstat64(const char *path, struct stat64 *buf); |
588 | int _win_readlink(const char *path, char *buf, size_t bufsize); | 590 | int _win_readlink(const char *path, char *buf, size_t bufsize); |
589 | int _win_accept(int s, struct sockaddr *addr, int *addrlen); | 591 | int _win_accept(int s, struct sockaddr *addr, int *addrlen); |
@@ -610,6 +612,7 @@ int _win_setsockopt(int s, int level, int optname, const void *optval, | |||
610 | int optlen); | 612 | int optlen); |
611 | int _win_shutdown(int s, int how); | 613 | int _win_shutdown(int s, int how); |
612 | int _win_socket(int af, int type, int protocol); | 614 | int _win_socket(int af, int type, int protocol); |
615 | int _win_socketpair(int af, int type, int protocol, int socket_vector[2]); | ||
613 | struct hostent *_win_gethostbyaddr(const char *addr, int len, int type); | 616 | struct hostent *_win_gethostbyaddr(const char *addr, int len, int type); |
614 | struct hostent *_win_gethostbyname(const char *name); | 617 | struct hostent *_win_gethostbyname(const char *name); |
615 | struct hostent *gethostbyname2(const char *name, int af); | 618 | struct hostent *gethostbyname2(const char *name, int af); |
@@ -658,6 +661,7 @@ char *strcasestr(const char *haystack_start, const char *needle_start); | |||
658 | #define FOPEN(f, m) fopen(f, m) | 661 | #define FOPEN(f, m) fopen(f, m) |
659 | #define FCLOSE(f) fclose(f) | 662 | #define FCLOSE(f) fclose(f) |
660 | #define FTRUNCATE(f, l) ftruncate(f, l) | 663 | #define FTRUNCATE(f, l) ftruncate(f, l) |
664 | #define TRUNCATE(f, l) truncate(f, l) | ||
661 | #define OPENDIR(d) opendir(d) | 665 | #define OPENDIR(d) opendir(d) |
662 | #define CLOSEDIR(d) closedir(d) | 666 | #define CLOSEDIR(d) closedir(d) |
663 | #define READDIR(d) readdir(d) | 667 | #define READDIR(d) readdir(d) |
@@ -722,6 +726,7 @@ char *strcasestr(const char *haystack_start, const char *needle_start); | |||
722 | #define SETSOCKOPT(s, l, o, v, n) setsockopt(s, l, o, v, n) | 726 | #define SETSOCKOPT(s, l, o, v, n) setsockopt(s, l, o, v, n) |
723 | #define SHUTDOWN(s, h) shutdown(s, h) | 727 | #define SHUTDOWN(s, h) shutdown(s, h) |
724 | #define SOCKET(a, t, p) socket(a, t, p) | 728 | #define SOCKET(a, t, p) socket(a, t, p) |
729 | #define SOCKETPAIR(a, t, p, v) socketpair(a, t, p, v) | ||
725 | #define GETHOSTBYADDR(a, l, t) gethostbyaddr(a, l, t) | 730 | #define GETHOSTBYADDR(a, l, t) gethostbyaddr(a, l, t) |
726 | #define GETHOSTBYNAME(n) gethostbyname(n) | 731 | #define GETHOSTBYNAME(n) gethostbyname(n) |
727 | #define GETTIMEOFDAY(t, n) gettimeofday(t, n) | 732 | #define GETTIMEOFDAY(t, n) gettimeofday(t, n) |
@@ -756,6 +761,7 @@ char *strcasestr(const char *haystack_start, const char *needle_start); | |||
756 | #define FOPEN(f, m) _win_fopen(f, m) | 761 | #define FOPEN(f, m) _win_fopen(f, m) |
757 | #define FCLOSE(f) _win_fclose(f) | 762 | #define FCLOSE(f) _win_fclose(f) |
758 | #define FTRUNCATE(f, l) _win_ftruncate(f, l) | 763 | #define FTRUNCATE(f, l) _win_ftruncate(f, l) |
764 | #define TRUNCATE(f, l) _win_truncate(f, l) | ||
759 | #define OPENDIR(d) _win_opendir(d) | 765 | #define OPENDIR(d) _win_opendir(d) |
760 | #define CLOSEDIR(d) _win_closedir(d) | 766 | #define CLOSEDIR(d) _win_closedir(d) |
761 | #define READDIR(d) _win_readdir(d) | 767 | #define READDIR(d) _win_readdir(d) |
@@ -820,6 +826,7 @@ char *strcasestr(const char *haystack_start, const char *needle_start); | |||
820 | #define SETSOCKOPT(s, l, o, v, n) _win_setsockopt(s, l, o, v, n) | 826 | #define SETSOCKOPT(s, l, o, v, n) _win_setsockopt(s, l, o, v, n) |
821 | #define SHUTDOWN(s, h) _win_shutdown(s, h) | 827 | #define SHUTDOWN(s, h) _win_shutdown(s, h) |
822 | #define SOCKET(a, t, p) _win_socket(a, t, p) | 828 | #define SOCKET(a, t, p) _win_socket(a, t, p) |
829 | #define SOCKETPAIR(a, t, p, v) _win_socketpair(a, t, p, v) | ||
823 | #define GETHOSTBYADDR(a, l, t) _win_gethostbyaddr(a, l, t) | 830 | #define GETHOSTBYADDR(a, l, t) _win_gethostbyaddr(a, l, t) |
824 | #define GETHOSTBYNAME(n) _win_gethostbyname(n) | 831 | #define GETHOSTBYNAME(n) _win_gethostbyname(n) |
825 | #define GETTIMEOFDAY(t, n) gettimeofday(t, n) | 832 | #define GETTIMEOFDAY(t, n) gettimeofday(t, n) |