diff options
author | Petter Rodhelind <petter.rodhelind@gmail.com> | 2020-01-14 11:41:08 +0100 |
---|---|---|
committer | Petter Rodhelind <petter.rodhelind@gmail.com> | 2020-01-14 11:41:08 +0100 |
commit | 02d7aa8915f9c3a3288dab01f321eb94ba219e3b (patch) | |
tree | f053238978479e408a2b83571443e132f30586ab /include/libc.h | |
parent | c0c9d8f883dfd3a7f5a74499d91bb95884b15873 (diff) | |
parent | 3d1382b98a502d0c34d5ba2c462396acc515016e (diff) | |
download | plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.tar.gz plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.tar.bz2 plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/libc.h')
-rw-r--r-- | include/libc.h | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/include/libc.h b/include/libc.h index 45b22b69..4fa86b22 100644 --- a/include/libc.h +++ b/include/libc.h @@ -11,13 +11,13 @@ #define _LIBC_H_ 1 #if defined(__cplusplus) extern "C" { -#endif +#endif #include <utf.h> #include <fmt.h> /* - * Begin usual libc.h + * Begin usual libc.h */ #ifndef nil @@ -361,7 +361,7 @@ enum extern int p9atexit(void(*)(void)); extern void p9atexitdont(void(*)(void)); extern int atnotify(int(*)(void*, char*), int); -/* +/* * <stdlib.h> extern double atof(char*); <stdlib.h> */ @@ -383,8 +383,11 @@ extern int encodefmt(Fmt*); extern int dirmodefmt(Fmt*); extern int exitcode(char*); extern void exits(char*); -extern double frexp(double, int*); +extern double p9frexp(double, int*); extern ulong getcallerpc(void*); +#if defined(__GNUC__) || defined(__clang__) +#define getcallerpc(x) ((ulong)__builtin_return_address(0)) +#endif extern char* p9getenv(char*); extern int p9putenv(char*, char*); extern int getfields(char*, char**, int, int, char*); @@ -433,6 +436,8 @@ extern void (*_unpin)(void); #define atoll p9atoll #define encrypt p9encrypt #define decrypt p9decrypt +#undef frexp +#define frexp p9frexp #define getenv p9getenv #define getwd p9getwd #define longjmp p9longjmp @@ -479,7 +484,7 @@ extern void lock(Lock*); extern void unlock(Lock*); extern int canlock(Lock*); extern int (*_lock)(Lock*, int, ulong); -extern void (*_unlock)(Lock*, ulong); +extern void (*_unlock)(Lock*, ulong); typedef struct QLock QLock; struct QLock @@ -670,15 +675,15 @@ extern void freenetconninfo(NetConnInfo*); enum { - RFNAMEG = (1<<0), - RFENVG = (1<<1), + RFNAMEG = (1<<0), + RFENVG = (1<<1), RFFDG = (1<<2), RFNOTEG = (1<<3), RFPROC = (1<<4), RFMEM = (1<<5), RFNOWAIT = (1<<6), - RFCNAMEG = (1<<10), - RFCENVG = (1<<11), + RFCNAMEG = (1<<10), + RFCENVG = (1<<11), RFCFDG = (1<<12) /* RFREND = (1<<13), */ /* RFNOMNT = (1<<14) */ @@ -707,7 +712,7 @@ struct Dir { char *uid; /* owner name */ char *gid; /* group name */ char *muid; /* last modifier name */ - + /* 9P2000.u extensions */ uint uidnum; /* numeric uid */ uint gidnum; /* numeric gid */ @@ -750,7 +755,7 @@ extern int p9exec(char*, char*[]); extern int p9execl(char*, ...); /* extern int p9fork(void); */ extern int p9rfork(int); -/* not implemented +/* not implemented extern int fauth(int, char*); extern int fstat(int, uchar*, int); extern int fwstat(int, uchar*, int); @@ -767,7 +772,7 @@ extern int notifyoff(char*); extern int p9open(char*, int); extern int fd2path(int, char*, int); extern int p9pipe(int*); -/* +/* * use defs from <unistd.h> extern long pread(int, void*, long, vlong); extern long preadv(int, IOchunk*, int, vlong); |