add remaining lfs64 and locale functions
authorSzabolcs Nagy <nsz@port70.net>
Tue, 7 Jan 2014 23:05:33 +0000 (00:05 +0100)
committerSzabolcs Nagy <nsz@port70.net>
Tue, 7 Jan 2014 23:05:33 +0000 (00:05 +0100)
func.h
wrap.c

diff --git a/func.h b/func.h
index a167cf1..7291aee 100644 (file)
--- a/func.h
+++ b/func.h
@@ -1,4 +1,56 @@
+#undef __fxstat64
+#undef __fxstatat64
+#undef __lxstat64
+#undef __xstat64
+#undef alphasort64
+#undef creat64
+#undef fallocate64
+#undef fgetpos64
+#undef fopen64
+#undef freopen64
+#undef fseeko64
+#undef fsetpos64
+#undef fstat64
+#undef fstatat64
+#undef fstatfs64
+#undef fstatvfs64
+#undef ftello64
+#undef ftruncate64
+#undef ftw64
+#undef getdents64
+#undef getrlimit64
+#undef glob64
+#undef globfree64
+#undef lockf64
+#undef lseek64
+#undef lstat64
+#undef mkostemp64
+#undef mkostemps64
+#undef mkstemp64
+#undef mkstemps64
+#undef mmap64
+#undef nftw64
+#undef open64
+#undef openat64
+#undef posix_fadvise64
+#undef posix_fallocate64
+#undef pread64
+#undef preadv64
+#undef prlimit64
+#undef pwrite64
+#undef pwritev64
+#undef readdir64
+#undef readdir64_r
+#undef scandir64
+#undef sendfile64
+#undef setrlimit64
+#undef stat64
+#undef statfs64
+#undef statvfs64
+#undef tmpfile64
+#undef truncate64
 typedef void (*signal_handler)(int);
+typedef struct tre_mem_struct *tre_mem_t;
 
 V(_Noreturn void, _Exit, (int ec), (ec))
 F(int, _IO_getc, (FILE *f), (f))
@@ -89,7 +141,9 @@ F(int, __fwritable, (FILE *f), (f))
 F(size_t, __fwritex, (const unsigned char *restrict s, size_t l, FILE *restrict f), (s,l,f))
 F(int, __fwriting, (FILE *f), (f))
 F(int, __fxstat, (int ver, int fd, struct stat *buf), (ver,fd,buf))
+F(int, __fxstat64, (int ver, int fd, struct stat *buf), (ver,fd,buf))
 F(int, __fxstatat, (int ver, int fd, const char *path, struct stat *buf, int flag), (ver,fd,path,buf,flag))
+F(int, __fxstatat64, (int ver, int fd, const char *path, struct stat *buf, int flag), (ver,fd,path,buf,flag))
 V(void, __get_handler_set, (sigset_t *set), (set))
 F(ssize_t, __getdelim, (char **restrict s, size_t *restrict n, int delim, FILE *restrict f), (s,n,delim,f))
 F(int, __getdents, (int fd, struct dirent *buf, size_t len), (fd,buf,len))
@@ -118,6 +172,7 @@ F(int, __isoc99_vsscanf, (const char *restrict s, const char *restrict fmt, va_l
 F(int, __isoc99_vswscanf, (const wchar_t *restrict s, const wchar_t *restrict fmt, va_list ap), (s,fmt,ap))
 F(int, __isoc99_vwscanf, (const wchar_t *restrict fmt, va_list ap), (fmt,ap))
 XF(int, __isoc99_wscanf, (const wchar_t *restrict fmt, ...))
+F(int, __iswctype_l, (wint_t c, wctype_t t, locale_t l), (c,t,l))
 F(double complex, __ldexp_cexp, (double complex z, int expt), (z,expt))
 F(float complex, __ldexp_cexpf, (float complex z, int expt), (z,expt))
 F(double, __lgamma_r, (double x, int *signgamp), (x,signgamp))
@@ -134,6 +189,7 @@ V(void, __lock, (volatile int *l), (l))
 F(int, __lockfile, (FILE *f), (f))
 V(_Noreturn void, __longjmp, (jmp_buf buf, int v), (buf,v))
 F(int, __lxstat, (int ver, const char *path, struct stat *buf), (ver,path,buf))
+F(int, __lxstat64, (int ver, const char *path, struct stat *buf), (ver,path,buf))
 F(int, __madvise, (void *addr, size_t len, int advice), (addr,len,advice))
 F(const char unsigned *, __map_file, (const char *pathname, size_t *size), (pathname,size))
 F(void *, __memalign, (size_t align, size_t len), (align,len))
@@ -205,15 +261,20 @@ F(char *, __strdup, (const char *s), (s))
 F(const char *, __strftime_fmt_1, (char (*s)[100], size_t *l, int f, const struct tm *tm, locale_t loc), (s,l,f,tm,loc))
 F(size_t, __strftime_l, (char *restrict s, size_t n, const char *restrict f, const struct tm *restrict tm, locale_t loc), (s,n,f,tm,loc))
 F(size_t, __string_read, (FILE *f, unsigned char *buf, size_t len), (f,buf,len))
+F(double, __strtod_l, (const char *restrict s, char **restrict p, locale_t l), (s,p,l))
+F(float, __strtof_l, (const char *restrict s, char **restrict p, locale_t l), (s,p,l))
 F(intmax_t, __strtoimax_internal, (const char *restrict s, char **restrict p, int base), (s,p,base))
 F(long, __strtol_internal, (const char *restrict s, char **restrict p, int base), (s,p,base))
+F(long double, __strtold_l, (const char *restrict s, char **restrict p, locale_t l), (s,p,l))
 F(long long, __strtoll_internal, (const char *restrict s, char **restrict p, int base), (s,p,base))
 F(unsigned long, __strtoul_internal, (const char *restrict s, char **restrict p, int base), (s,p,base))
 F(unsigned long long, __strtoull_internal, (const char *restrict s, char **restrict p, int base), (s,p,base))
 F(uintmax_t, __strtoumax_internal, (const char *restrict s, char **restrict p, int base), (s,p,base))
 F(size_t, __strxfrm_l, (char *restrict dest, const char *restrict src, size_t n, locale_t loc), (dest,src,n,loc))
 V(void, __synccall, (void (*func)(void *), void *ctx), (func,ctx))
+XF(long, __syscall, (long n, ...))
 F(long, __syscall_cp, (long nr, long u, long v, long w, long x, long y, long z), (nr,u,v,w,x,y,z))
+F(long, __syscall_cp_asm, (volatile void *p, long nr, long u, long v, long w, long x, long y, long z), (p,nr,u,v,w,x,y,z))
 F(long, __syscall_ret, (unsigned long r), (r))
 F(double, __tan, (double x, double y, int odd), (x,y,odd))
 F(float, __tandf, (double x, int odd), (x,odd))
@@ -224,12 +285,16 @@ F(void *, __tls_get_addr, (size_t *v), (v))
 F(long long, __tm_to_secs, (const struct tm *tm), (tm))
 F(const char *, __tm_to_tzname, (const struct tm *tm), (tm))
 F(int, __toread, (FILE *f), (f))
+F(wint_t, __towlower_l, (wint_t c, locale_t l), (c,l))
+F(wint_t, __towupper_l, (wint_t c, locale_t l), (c,l))
 F(int, __towrite, (FILE *f), (f))
 V(void, __tzset, (), ())
 F(int, __uflow, (FILE *f), (f))
 V(void, __unlock, (volatile int *l), (l))
 V(void, __unlockfile, (FILE *f), (f))
+V(void, __unmapself, (void *p, size_t n), (p,n))
 F(locale_t, __uselocale, (locale_t l), (l))
+F(int, __vdso_clock_gettime, (clockid_t clk, struct timespec *ts), (clk,ts))
 F(pid_t, __vfork, (void), ())
 V(void, __vm_lock, (int inc), (inc))
 V(void, __vm_lock_impl, (int inc), (inc))
@@ -240,9 +305,11 @@ V(void, __wait, (volatile int *addr, volatile int *waiters, int val, int priv),
 F(int, __wcscoll_l, (const wchar_t *l, const wchar_t *r, locale_t locale), (l,r,locale))
 F(size_t, __wcsftime_l, (wchar_t *restrict s, size_t n, const wchar_t *restrict f, const struct tm *restrict tm, locale_t loc), (s,n,f,tm,loc))
 F(size_t, __wcsxfrm_l, (wchar_t *restrict dest, const wchar_t *restrict src, size_t n, locale_t loc), (dest,src,n,loc))
+F(wctype_t, __wctype_l, (const char *s, locale_t l), (s,l))
 F(char *, __xpg_basename, (char *s), (s))
 F(int, __xpg_strerror_r, (int err, char *buf, size_t buflen), (err,buf,buflen))
 F(int, __xstat, (int ver, const char *path, struct stat *buf), (ver,path,buf))
+F(int, __xstat64, (int ver, const char *path, struct stat *buf), (ver,path,buf))
 F(long long, __year_to_secs, (long long year, int *is_leap), (year,is_leap))
 F(int, __yield, (), ())
 V(void, _dl_debug_state, (void), ())
@@ -280,6 +347,7 @@ F(int, aio_write, (struct aiocb *cb), (cb))
 F(unsigned, alarm, (unsigned seconds), (seconds))
 F(void *, aligned_alloc, (size_t align, size_t len), (align,len))
 F(int, alphasort, (const struct dirent **a, const struct dirent **b), (a,b))
+F(int, alphasort64, (const struct dirent **a, const struct dirent **b), (a,b))
 F(int, arch_prctl, (int code, unsigned long addr), (code,addr))
 F(char *, asctime, (const struct tm *tm), (tm))
 F(char *, asctime_r, (const struct tm *restrict tm, char *restrict buf), (tm,buf))
@@ -417,6 +485,7 @@ F(double, creal, (double complex z), (z))
 F(float, crealf, (float complex z), (z))
 F(long double, creall, (long double complex z), (z))
 F(int, creat, (const char *filename, mode_t mode), (filename,mode))
+F(int, creat64, (const char *filename, mode_t mode), (filename,mode))
 F(char *, crypt, (const char *key, const char *salt), (key,salt))
 F(char *, crypt_r, (const char *key, const char *salt, struct crypt_data *data), (key,salt,data))
 F(double complex, csin, (double complex z), (z))
@@ -458,7 +527,7 @@ F(int, dn_comp, (const char *src, unsigned char *dst, int space, unsigned char *
 F(int, dn_expand, (const unsigned char *base, const unsigned char *end, const unsigned char *src, char *dest, int space), (base,end,src,dest,space))
 F(int, dn_skipname, (const unsigned char *s, const unsigned char *end), (s,end))
 F(char *, dngettext, (const char *domainname, const char *msgid1, const char *msgid2, unsigned long int n), (domainname,msgid1,msgid2,n))
-XF(int, dprintf, (int fd, const char *restrict fmt, ...))
+//XF(int, dprintf, (int fd, const char *restrict fmt, ...))
 F(double, drand48, (void), ())
 F(double, drem, (double x, double y), (x,y))
 F(float, dremf, (float x, float y), (x,y))
@@ -471,12 +540,14 @@ F(char *, ecvt, (double x, int n, int *dp, int *sign), (x,n,dp,sign))
 V(void, endgrent, (), ())
 V(void, endhostent, (void), ())
 F(int, endmntent, (FILE *f), (f))
+V(void, endnetent, (void), ())
 V(void, endprotoent, (void), ())
 V(void, endpwent, (), ())
 V(void, endservent, (void), ())
 V(void, endspent, (), ())
 V(void, endusershell, (void), ())
 V(void, endutxent, (void), ())
+V(void, endutent, (void), ())
 F(int, epoll_create, (int size), (size))
 F(int, epoll_create1, (int flags), (flags))
 F(int, epoll_ctl, (int fd, int op, int fd2, struct epoll_event *ev), (fd,op,fd2,ev))
@@ -567,6 +638,7 @@ F(wint_t, fgetwc_unlocked, (FILE *f), (f))
 F(struct group *, fgetgrent, (FILE *f), (f))
 F(char *, fgetln, (FILE *f, size_t *plen), (f,plen))
 F(int, fgetpos, (FILE *restrict f, fpos_t *restrict pos), (f,pos))
+F(int, fgetpos64, (FILE *restrict f, fpos_t *restrict pos), (f,pos))
 F(struct passwd *, fgetpwent, (FILE *f), (f))
 F(char *, fgets, (char *restrict s, int n, FILE *restrict f), (s,n,f))
 F(char *, fgets_unlocked, (char *restrict s, int n, FILE *restrict f), (s,n,f))
@@ -600,6 +672,7 @@ F(float, fmodf, (float x, float y), (x,y))
 F(long double, fmodl, (long double x, long double y), (x,y))
 F(int, fnmatch, (const char *pat, const char *str, int flags), (pat,str,flags))
 F(FILE *, fopen, (const char *restrict filename, const char *restrict mode), (filename,mode))
+F(FILE *, fopen64, (const char *restrict filename, const char *restrict mode), (filename,mode))
 F(pid_t, fork, (void), ())
 F(int, forkpty, (int *m, char *name, const struct termios *tio, const struct winsize *ws), (m,name,tio,ws))
 F(long, fpathconf, (int fd, int name), (fd,name))
@@ -621,26 +694,36 @@ V(void, freeifaddrs, (struct ifaddrs *ifp), (ifp))
 V(void, freelocale, (locale_t l), (l))
 F(int, fremovexattr, (int fd, const char *name), (fd,name))
 F(FILE *, freopen, (const char *restrict filename, const char *restrict mode, FILE *restrict f), (filename,mode,f))
+F(FILE *, freopen64, (const char *restrict filename, const char *restrict mode, FILE *restrict f), (filename,mode,f))
 F(double, frexp, (double x, int *e), (x,e))
 F(float, frexpf, (float x, int *e), (x,e))
 F(long double, frexpl, (long double x, int *e), (x,e))
 XF(int, fscanf, (FILE *restrict f, const char *restrict fmt, ...))
 F(int, fseek, (FILE *f, long off, int whence), (f,off,whence))
 F(int, fseeko, (FILE *f, off_t off, int whence), (f,off,whence))
+F(int, fseeko64, (FILE *f, off_t off, int whence), (f,off,whence))
 F(int, fsetpos, (FILE *f, const fpos_t *pos), (f,pos))
+F(int, fsetpos64, (FILE *f, const fpos_t *pos), (f,pos))
 F(int, fsetxattr, (int filedes, const char *name, const void *value, size_t size, int flags), (filedes,name,value,size,flags))
 F(int, fstat, (int fd, struct stat *st), (fd,st))
+F(int, fstat64, (int fd, struct stat *st), (fd,st))
 F(int, fstatat, (int fd, const char *restrict path, struct stat *restrict buf, int flag), (fd,path,buf,flag))
+F(int, fstatat64, (int fd, const char *restrict path, struct stat *restrict buf, int flag), (fd,path,buf,flag))
 F(int, fstatfs, (int fd, struct statfs *buf), (fd,buf))
+F(int, fstatfs64, (int fd, struct statfs *buf), (fd,buf))
 F(int, fstatvfs, (int fd, struct statvfs *buf), (fd,buf))
+F(int, fstatvfs64, (int fd, struct statvfs *buf), (fd,buf))
 F(int, fsync, (int fd), (fd))
 F(long, ftell, (FILE *f), (f))
 F(off_t, ftello, (FILE *f), (f))
+F(off_t, ftello64, (FILE *f), (f))
 F(int, ftime, (struct timeb *tp), (tp))
 F(key_t, ftok, (const char *path, int id), (path,id))
 F(int, ftruncate, (int fd, off_t length), (fd,length))
+F(int, ftruncate64, (int fd, off_t length), (fd,length))
 F(int, ftrylockfile, (FILE *f), (f))
 F(int, ftw, (const char *path, int (*fn)(const char *, const struct stat *, int), int fd_limit), (path,fn,fd_limit))
+F(int, ftw64, (const char *path, int (*fn)(const char *, const struct stat *, int), int fd_limit), (path,fn,fd_limit))
 V(void, funlockfile, (FILE *f), (f))
 F(int, futimens, (int fd, const struct timespec times[2]), (fd,times))
 F(int, futimes, (int fd, const struct timeval tv[2]), (fd,tv))
@@ -662,6 +745,7 @@ F(char *, getcwd, (char *buf, size_t size), (buf,size))
 F(struct tm *, getdate, (const char *s), (s))
 F(ssize_t, getdelim, (char **restrict s, size_t *restrict n, int delim, FILE *restrict f), (s,n,delim,f))
 F(int, getdents, (int fd, struct dirent *buf, size_t len), (fd,buf,len))
+F(int, getdents64, (int fd, struct dirent *buf, size_t len), (fd,buf,len))
 F(int, getdomainname, (char *name, size_t len), (name,len))
 F(int, getdtablesize, (void), ())
 F(gid_t, getegid, (void), ())
@@ -693,6 +777,7 @@ F(int, getlogin_r, (char *name, size_t size), (name,size))
 F(struct mntent *, getmntent, (FILE *f), (f))
 F(struct mntent *, getmntent_r, (FILE *f, struct mntent *mnt, char *linebuf, int buflen), (f,mnt,linebuf,buflen))
 F(int, getnameinfo, (const struct sockaddr *restrict sa, socklen_t sl, char *restrict node, socklen_t nodelen, char *restrict serv, socklen_t servlen, int flags), (sa,sl,node,nodelen,serv,servlen,flags))
+F(struct netent *, getnetent, (void), ())
 F(struct netent *, getnetbyaddr, (uint32_t net, int type), (net,type))
 F(struct netent *, getnetbyname, (const char *name), (name))
 F(int, getopt, (int argc, char * const argv[], const char *optstring), (argc,argv,optstring))
@@ -717,6 +802,7 @@ F(int, getpwuid_r, (uid_t uid, struct passwd *pw, char *buf, size_t size, struct
 F(int, getresgid, (gid_t *rgid, gid_t *egid, gid_t *sgid), (rgid,egid,sgid))
 F(int, getresuid, (uid_t *ruid, uid_t *euid, uid_t *suid), (ruid,euid,suid))
 F(int, getrlimit, (int resource, struct rlimit *rlim), (resource,rlim))
+F(int, getrlimit64, (int resource, struct rlimit *rlim), (resource,rlim))
 F(int, getrusage, (int who, struct rusage *ru), (who,ru))
 F(char *, gets, (char *s), (s))
 F(struct servent *, getservbyname, (const char *name, const char *prots), (name,prots))
@@ -735,6 +821,9 @@ F(char *, gettext, (const char *msgid), (msgid))
 F(int, gettimeofday, (struct timeval *restrict tv, void *restrict tz), (tv,tz))
 F(uid_t, getuid, (void), ())
 F(char *, getusershell, (void), ())
+F(struct utmp *, getutent, (void), ())
+F(struct utmp *, getutid, (const struct utmp *ut), (ut))
+F(struct utmp *, getutline, (const struct utmp *ut), (ut))
 F(struct utmpx *, getutxent, (void), ())
 F(struct utmpx *, getutxid, (const struct utmpx *ut), (ut))
 F(struct utmpx *, getutxline, (const struct utmpx *ut), (ut))
@@ -745,7 +834,9 @@ F(wint_t, getwchar, (void), ())
 F(wint_t, getwchar_unlocked, (void), ())
 F(ssize_t, getxattr, (const char *path, const char *name, void *value, size_t size), (path,name,value,size))
 F(int, glob, (const char *restrict pat, int flags, int (*errfunc)(const char *path, int err), glob_t *restrict g), (pat,flags,errfunc,g))
+F(int, glob64, (const char *restrict pat, int flags, int (*errfunc)(const char *path, int err), glob_t *restrict g), (pat,flags,errfunc,g))
 V(void, globfree, (glob_t *g), (g))
+V(void, globfree64, (glob_t *g), (g))
 F(struct tm *, gmtime, (const time_t *t), (t))
 F(struct tm *, gmtime_r, (const time_t *restrict t, struct tm *restrict tm), (t,tm))
 F(int, grantpt, (int fd), (fd))
@@ -892,6 +983,7 @@ F(struct lconv *, localeconv, (void), ())
 F(struct tm *, localtime, (const time_t *t), (t))
 F(struct tm *, localtime_r, (const time_t *restrict t, struct tm *restrict tm), (t,tm))
 F(int, lockf, (int fd, int op, off_t size), (fd,op,size))
+F(int, lockf64, (int fd, int op, off_t size), (fd,op,size))
 F(double, log, (double x), (x))
 F(double, log10, (double x), (x))
 F(float, log10f, (float x), (x))
@@ -918,8 +1010,10 @@ F(long, lroundf, (float x), (x))
 F(long, lroundl, (long double x), (x))
 F(void *, lsearch, (const void *key, void *base, size_t *nelp, size_t width, int (*compar)(const void *, const void *)), (key,base,nelp,width,compar))
 F(off_t, lseek, (int fd, off_t offset, int whence), (fd,offset,whence))
+F(off_t, lseek64, (int fd, off_t offset, int whence), (fd,offset,whence))
 F(int, lsetxattr, (const char *path, const char *name, const void *value, size_t size, int flags), (path,name,value,size,flags))
 F(int, lstat, (const char *restrict path, struct stat *restrict buf), (path,buf))
+F(int, lstat64, (const char *restrict path, struct stat *restrict buf), (path,buf))
 F(int, lutimes, (const char *filename, const struct timeval tv[2]), (filename,tv))
 F(int, madvise, (void *addr, size_t len, int advice), (addr,len,advice))
 F(void *, malloc, (size_t n), (n))
@@ -950,14 +1044,19 @@ F(int, mkfifoat, (int fd, const char *path, mode_t mode), (fd,path,mode))
 F(int, mknod, (const char *path, mode_t mode, dev_t dev), (path,mode,dev))
 F(int, mknodat, (int fd, const char *path, mode_t mode, dev_t dev), (fd,path,mode,dev))
 F(int, mkostemp, (char *template, int flags), (template,flags))
+F(int, mkostemp64, (char *template, int flags), (template,flags))
 F(int, mkostemps, (char *template, int len, int flags), (template,len,flags))
+F(int, mkostemps64, (char *template, int len, int flags), (template,len,flags))
 F(int, mkstemp, (char *template), (template))
+F(int, mkstemp64, (char *template), (template))
 F(int, mkstemps, (char *template, int len), (template,len))
+F(int, mkstemps64, (char *template, int len), (template,len))
 F(char *, mktemp, (char *template), (template))
 F(time_t, mktime, (struct tm *tm), (tm))
 F(int, mlock, (const void *addr, size_t len), (addr,len))
 F(int, mlockall, (int flags), (flags))
 F(void *, mmap, (void *start, size_t len, int prot, int flags, int fd, off_t off), (start,len,prot,flags,fd,off))
+F(void *, mmap64, (void *start, size_t len, int prot, int flags, int fd, off_t off), (start,len,prot,flags,fd,off))
 F(double, modf, (double x, double *iptr), (x,iptr))
 F(float, modff, (float x, float *iptr), (x,iptr))
 F(long double, modfl, (long double x, long double *iptr), (x,iptr))
@@ -998,6 +1097,7 @@ F(double, nexttoward, (double x, long double y), (x,y))
 F(float, nexttowardf, (float x, long double y), (x,y))
 F(long double, nexttowardl, (long double x, long double y), (x,y))
 F(int, nftw, (const char *path, int (*fn)(const char *, const struct stat *, int, struct FTW *), int fd_limit, int flags), (path,fn,fd_limit,flags))
+F(int, nftw64, (const char *path, int (*fn)(const char *, const struct stat *, int, struct FTW *), int fd_limit, int flags), (path,fn,fd_limit,flags))
 F(char *, ngettext, (const char *msgid1, const char *msgid2, unsigned long int n), (msgid1,msgid2,n))
 F(int, nice, (int inc), (inc))
 F(char *, nl_langinfo, (nl_item item), (item))
@@ -1006,9 +1106,11 @@ F(long, nrand48, (unsigned short s[3]), (s))
 F(uint32_t, ntohl, (uint32_t n), (n))
 F(uint16_t, ntohs, (uint16_t n), (n))
 XF(int, open, (const char *filename, int flags, ...))
+XF(int, open64, (const char *filename, int flags, ...))
 F(FILE *, open_memstream, (char **bufp, size_t *sizep), (bufp,sizep))
 F(FILE *, open_wmemstream, (wchar_t **bufp, size_t *sizep), (bufp,sizep))
 XF(int, openat, (int fd, const char *filename, int flags, ...))
+XF(int, openat64, (int fd, const char *filename, int flags, ...))
 F(DIR *, opendir, (const char *name), (name))
 V(void, openlog, (const char *ident, int opt, int facility), (ident,opt,facility))
 F(int, openpty, (int *m, int *s, char *name, const struct termios *tio, const struct winsize *ws), (m,s,name,tio,ws))
@@ -1058,9 +1160,12 @@ F(long double, powl, (long double x, long double y), (x,y))
 F(int, ppoll, (struct pollfd *fds, nfds_t n, const struct timespec *to, const sigset_t *mask), (fds,n,to,mask))
 XF(int, prctl, (int op, ...))
 F(ssize_t, pread, (int fd, void *buf, size_t size, off_t ofs), (fd,buf,size,ofs))
+F(ssize_t, pread64, (int fd, void *buf, size_t size, off_t ofs), (fd,buf,size,ofs))
 F(ssize_t, preadv, (int fd, const struct iovec *iov, int count, off_t ofs), (fd,iov,count,ofs))
+F(ssize_t, preadv64, (int fd, const struct iovec *iov, int count, off_t ofs), (fd,iov,count,ofs))
 XF(int, printf, (const char *restrict fmt, ...))
 F(int, prlimit, (pid_t pid, int resource, const struct rlimit *new_limit, struct rlimit *old_limit), (pid,resource,new_limit,old_limit))
+F(int, prlimit64, (pid_t pid, int resource, const struct rlimit *new_limit, struct rlimit *old_limit), (pid,resource,new_limit,old_limit))
 F(ssize_t, process_vm_readv, (pid_t pid, const struct iovec *lvec, unsigned long liovcnt, const struct iovec *rvec, unsigned long riovcnt, unsigned long flags), (pid,lvec,liovcnt,rvec,riovcnt,flags))
 F(ssize_t, process_vm_writev, (pid_t pid, const struct iovec *lvec, unsigned long liovcnt, const struct iovec *rvec, unsigned long riovcnt, unsigned long flags), (pid,lvec,liovcnt,rvec,riovcnt,flags))
 F(int, pselect, (int n, fd_set *restrict rfds, fd_set *restrict wfds, fd_set *restrict efds, const struct timespec *restrict ts, const sigset_t *restrict mask), (n,rfds,wfds,efds,ts,mask))
@@ -1179,6 +1284,7 @@ F(int, putgrent, (const struct group *gr, FILE *f), (gr,f))
 F(int, putpwent, (const struct passwd *pw, FILE *f), (pw,f))
 F(int, puts, (const char *s), (s))
 F(int, putspent, (const struct spwd *sp, FILE *f), (sp,f))
+F(struct utmp *, pututline, (const struct utmp *ut), (ut))
 F(struct utmpx *, pututxline, (const struct utmpx *ut), (ut))
 F(int, putw, (int x, FILE *f), (x,f))
 F(wint_t, putwc, (wchar_t c, FILE *f), (c,f))
@@ -1186,7 +1292,9 @@ F(wint_t, putwc_unlocked, (wchar_t c, FILE *f), (c,f))
 F(wint_t, putwchar, (wchar_t c), (c))
 F(wint_t, putwchar_unlocked, (wchar_t c), (c))
 F(ssize_t, pwrite, (int fd, const void *buf, size_t size, off_t ofs), (fd,buf,size,ofs))
+F(ssize_t, pwrite64, (int fd, const void *buf, size_t size, off_t ofs), (fd,buf,size,ofs))
 F(ssize_t, pwritev, (int fd, const struct iovec *iov, int count, off_t ofs), (fd,iov,count,ofs))
+F(ssize_t, pwritev64, (int fd, const struct iovec *iov, int count, off_t ofs), (fd,iov,count,ofs))
 V(void, qsort, (void *base, size_t nel, size_t width, int (*cmp)(const void*, const void*)), (base,nel,width,cmp))
 V(_Noreturn void, quick_exit, (int code), (code))
 F(int, quotactl, (int cmd, const char *special, int id, char *addr), (cmd,special,id,addr))
@@ -1197,7 +1305,9 @@ F(long, random, (void), ())
 F(ssize_t, read, (int fd, void *buf, size_t count), (fd,buf,count))
 F(ssize_t, readahead, (int fd, off_t pos, size_t len), (fd,pos,len))
 F(struct dirent *, readdir, (DIR *dir), (dir))
+F(struct dirent *, readdir64, (DIR *dir), (dir))
 F(int, readdir_r, (DIR *restrict dir, struct dirent *restrict buf, struct dirent **restrict result), (dir,buf,result))
+F(int, readdir64_r, (DIR *restrict dir, struct dirent *restrict buf, struct dirent **restrict result), (dir,buf,result))
 F(ssize_t, readlink, (const char *restrict path, char *restrict buf, size_t bufsize), (path,buf,bufsize))
 F(ssize_t, readlinkat, (int fd, const char *restrict path, char *restrict buf, size_t bufsize), (fd,path,buf,bufsize))
 F(ssize_t, readv, (int fd, const struct iovec *iov, int count), (fd,iov,count))
@@ -1246,6 +1356,7 @@ F(double, scalbn, (double x, int n), (x,n))
 F(float, scalbnf, (float x, int n), (x,n))
 F(long double, scalbnl, (long double x, int n), (x,n))
 F(int, scandir, (const char *path, struct dirent ***res, int (*sel)(const struct dirent *), int (*cmp)(const struct dirent **, const struct dirent **)), (path,res,sel,cmp))
+F(int, scandir64, (const char *path, struct dirent ***res, int (*sel)(const struct dirent *), int (*cmp)(const struct dirent **, const struct dirent **)), (path,res,sel,cmp))
 XF(int, scanf, (const char *restrict fmt, ...))
 F(int, sched_get_priority_max, (int policy), (policy))
 F(int, sched_get_priority_min, (int policy), (policy))
@@ -1276,6 +1387,7 @@ F(int, semop, (int id, struct sembuf *buf, size_t n), (id,buf,n))
 F(int, semtimedop, (int id, struct sembuf *buf, size_t n, const struct timespec *ts), (id,buf,n,ts))
 F(ssize_t, send, (int fd, const void *buf, size_t len, int flags), (fd,buf,len,flags))
 F(ssize_t, sendfile, (int out_fd, int in_fd, off_t *ofs, size_t count), (out_fd,in_fd,ofs,count))
+F(ssize_t, sendfile64, (int out_fd, int in_fd, off_t *ofs, size_t count), (out_fd,in_fd,ofs,count))
 F(ssize_t, sendmsg, (int fd, const struct msghdr *msg, int flags), (fd,msg,flags))
 F(ssize_t, sendto, (int fd, const void *buf, size_t len, int flags, const struct sockaddr *addr, socklen_t alen), (fd,buf,len,flags,addr,alen))
 V(void, setbuf, (FILE *restrict f, char *restrict buf), (f,buf))
@@ -1297,6 +1409,7 @@ V(void, setlinebuf, (FILE *f), (f))
 F(char *, setlocale, (int category, const char *locale), (category,locale))
 F(int, setlogmask, (int maskpri), (maskpri))
 F(FILE *, setmntent, (const char *name, const char *mode), (name,mode))
+V(void, setnetent, (int stayopen), (stayopen))
 F(int, setns, (int fd, int nstype), (fd,nstype))
 F(int, setpgid, (pid_t pid, pid_t pgid), (pid,pgid))
 F(pid_t, setpgrp, (void), ())
@@ -1308,6 +1421,7 @@ F(int, setresgid, (gid_t rgid, gid_t egid, gid_t sgid), (rgid,egid,sgid))
 F(int, setresuid, (uid_t ruid, uid_t euid, uid_t suid), (ruid,euid,suid))
 F(int, setreuid, (uid_t ruid, uid_t euid), (ruid,euid))
 F(int, setrlimit, (int resource, const struct rlimit *rlim), (resource,rlim))
+F(int, setrlimit64, (int resource, const struct rlimit *rlim), (resource,rlim))
 V(void, setservent, (int stayopen), (stayopen))
 F(pid_t, setsid, (void), ())
 F(int, setsockopt, (int fd, int level, int optname, const void *optval, socklen_t optlen), (fd,level,optname,optval,optlen))
@@ -1316,6 +1430,7 @@ F(char *, setstate, (char *state), (state))
 F(int, settimeofday, (const struct timeval *tv, const struct timezone *tz), (tv,tz))
 F(int, setuid, (uid_t uid), (uid))
 V(void, setusershell, (void), ())
+V(void, setutent, (void), ())
 V(void, setutxent, (void), ())
 F(int, setvbuf, (FILE *restrict f, char *restrict buf, int type, size_t size), (f,buf,type,size))
 F(int, setxattr, (const char *path, const char *name, const void *value, size_t size, int flags), (path,name,value,size,flags))
@@ -1379,8 +1494,11 @@ V(void, srand48, (long seed), (seed))
 V(void, srandom, (unsigned seed), (seed))
 XF(int, sscanf, (const char *restrict s, const char *restrict fmt, ...))
 F(int, stat, (const char *restrict path, struct stat *restrict buf), (path,buf))
+F(int, stat64, (const char *restrict path, struct stat *restrict buf), (path,buf))
 F(int, statfs, (const char *path, struct statfs *buf), (path,buf))
+F(int, statfs64, (const char *path, struct statfs *buf), (path,buf))
 F(int, statvfs, (const char *restrict path, struct statvfs *restrict buf), (path,buf))
+F(int, statvfs64, (const char *restrict path, struct statvfs *restrict buf), (path,buf))
 F(int, stime, (const time_t *t), (t))
 F(char *, stpcpy, (char *restrict d, const char *restrict s), (d,s))
 F(char *, stpncpy, (char *restrict d, const char *restrict s, size_t n), (d,s,n))
@@ -1392,6 +1510,7 @@ F(char *, strchr, (const char *s, int c), (s,c))
 F(char *, strchrnul, (const char *s, int c), (s,c))
 F(int, strcmp, (const char *l, const char *r), (l,r))
 F(int, strcoll, (const char *l, const char *r), (l,r))
+F(int, strcoll_l, (const char *l, const char *r, locale_t loc), (l,r,loc))
 F(char *, strcpy, (char *restrict dest, const char *restrict src), (dest,src))
 F(size_t, strcspn, (const char *s, const char *c), (s,c))
 F(char *, strdup, (const char *s), (s))
@@ -1401,6 +1520,7 @@ F(int, strerror_r, (int err, char *buf, size_t buflen), (err,buf,buflen))
 XF(ssize_t, strfmon, (char *restrict s, size_t n, const char *restrict fmt, ...))
 XF(ssize_t, strfmon_l, (char *restrict s, size_t n, locale_t loc, const char *restrict fmt, ...))
 F(size_t, strftime, (char *restrict s, size_t n, const char *restrict f, const struct tm *restrict tm), (s,n,f,tm))
+F(size_t, strftime_l, (char *restrict s, size_t n, const char *restrict f, const struct tm *restrict tm, locale_t loc), (s,n,f,tm,loc))
 F(size_t, strlcat, (char *d, const char *s, size_t n), (d,s,n))
 F(size_t, strlcpy, (char *d, const char *s, size_t n), (d,s,n))
 F(size_t, strlen, (const char *s), (s))
@@ -1419,21 +1539,22 @@ F(char *, strsignal, (int signum), (signum))
 F(size_t, strspn, (const char *s, const char *c), (s,c))
 F(char *, strstr, (const char *h, const char *n), (h,n))
 F(double, strtod, (const char *restrict s, char **restrict p), (s,p))
-//F(double, strtod_l, (const char *restrict s, char **restrict p, struct __locale_struct *l), (s,p,l))
+F(double, strtod_l, (const char *restrict s, char **restrict p, locale_t l), (s,p,l))
 F(float, strtof, (const char *restrict s, char **restrict p), (s,p))
-//F(float, strtof_l, (const char *restrict s, char **restrict p, struct __locale_struct *l), (s,p,l))
+F(float, strtof_l, (const char *restrict s, char **restrict p, locale_t l), (s,p,l))
 F(intmax_t, strtoimax, (const char *restrict s, char **restrict p, int base), (s,p,base))
 F(char *, strtok, (char *restrict s, const char *restrict sep), (s,sep))
 F(char *, strtok_r, (char *restrict s, const char *restrict sep, char **restrict p), (s,sep,p))
 F(long, strtol, (const char *restrict s, char **restrict p, int base), (s,p,base))
 F(long double, strtold, (const char *restrict s, char **restrict p), (s,p))
-//F(long double, strtold_l, (const char *restrict s, char **restrict p, struct __locale_struct *l), (s,p,l))
+F(long double, strtold_l, (const char *restrict s, char **restrict p, locale_t l), (s,p,l))
 F(long long, strtoll, (const char *restrict s, char **restrict p, int base), (s,p,base))
 F(unsigned long, strtoul, (const char *restrict s, char **restrict p, int base), (s,p,base))
 F(unsigned long long, strtoull, (const char *restrict s, char **restrict p, int base), (s,p,base))
 F(uintmax_t, strtoumax, (const char *restrict s, char **restrict p, int base), (s,p,base))
 F(int, strverscmp, (const char *l, const char *r), (l,r))
 F(size_t, strxfrm, (char *restrict dest, const char *restrict src, size_t n), (dest,src,n))
+F(size_t, strxfrm_l, (char *restrict dest, const char *restrict src, size_t n, locale_t loc), (dest,src,n,loc))
 V(void, swab, (const void *restrict _src, void *restrict _dest, ssize_t n), (_src,_dest,n))
 F(int, swapoff, (const char *path), (path))
 F(int, swapon, (const char *path, int flags), (path,flags))
@@ -1486,6 +1607,7 @@ F(int, timerfd_gettime, (int fd, struct itimerspec *cur), (fd,cur))
 F(int, timerfd_settime, (int fd, int flags, const struct itimerspec *new, struct itimerspec *old), (fd,flags,new,old))
 F(clock_t, times, (struct tms *tms), (tms))
 F(FILE *, tmpfile, (void), ())
+F(FILE *, tmpfile64, (void), ())
 F(char *, tmpnam, (char *s), (s))
 F(int, toascii, (int c), (c))
 F(int, tolower, (int c), (c))
@@ -1498,11 +1620,12 @@ F(wint_t, towlower, (wint_t wc), (wc))
 F(wint_t, towlower_l, (wint_t c, locale_t l), (c,l))
 F(wint_t, towupper, (wint_t wc), (wc))
 F(wint_t, towupper_l, (wint_t c, locale_t l), (c,l))
-//F(void *, __tre_mem_alloc_impl, (tre_mem_t mem, int provided, void *provided_block, int zero, size_t size), (mem,provided,provided_block,zero,size))
-//V(void, __tre_mem_destroy, (tre_mem_t mem), (mem))
-//F(tre_mem_t, __tre_mem_new_impl, (int provided, void *provided_block), (provided,provided_block))
+F(void *, __tre_mem_alloc_impl, (tre_mem_t mem, int provided, void *provided_block, int zero, size_t size), (mem,provided,provided_block,zero,size))
+V(void, __tre_mem_destroy, (tre_mem_t mem), (mem))
+F(tre_mem_t, __tre_mem_new_impl, (int provided, void *provided_block), (provided,provided_block))
 F(double, trunc, (double x), (x))
 F(int, truncate, (const char *path, off_t length), (path,length))
+F(int, truncate64, (const char *path, off_t length), (path,length))
 F(float, truncf, (float x), (x))
 F(long double, truncl, (long double x), (x))
 F(void *, tsearch, (const void *key, void **rootp, int (*compar)(const void *, const void *)), (key,rootp,compar))
@@ -1524,6 +1647,7 @@ F(int, unlinkat, (int fd, const char *path, int flag), (fd,path,flag))
 F(int, unlockpt, (int fd), (fd))
 F(int, unsetenv, (const char *name), (name))
 F(int, unshare, (int flags), (flags))
+V(void, updwtmp, (const char *f, const struct utmp *u), (f,u))
 V(void, updwtmpx, (const char *f, const struct utmpx *u), (f,u))
 F(locale_t, uselocale, (locale_t l), (l))
 F(int, usleep, (unsigned useconds), (useconds))
@@ -1571,10 +1695,12 @@ F(wchar_t *, wcscat, (wchar_t *restrict dest, const wchar_t *restrict src), (des
 F(wchar_t *, wcschr, (const wchar_t *s, wchar_t c), (s,c))
 F(int, wcscmp, (const wchar_t *l, const wchar_t *r), (l,r))
 F(int, wcscoll, (const wchar_t *l, const wchar_t *r), (l,r))
+F(int, wcscoll_l, (const wchar_t *l, const wchar_t *r, locale_t locale), (l,r,locale))
 F(wchar_t *, wcscpy, (wchar_t *restrict d, const wchar_t *restrict s), (d,s))
 F(size_t, wcscspn, (const wchar_t *s, const wchar_t *c), (s,c))
 F(wchar_t *, wcsdup, (const wchar_t *s), (s))
 F(size_t, wcsftime, (wchar_t *restrict wcs, size_t n, const wchar_t *restrict f, const struct tm *restrict tm), (wcs,n,f,tm))
+F(size_t, wcsftime_l, (wchar_t *restrict s, size_t n, const wchar_t *restrict f, const struct tm *restrict tm, locale_t loc), (s,n,f,tm,loc))
 F(size_t, wcslen, (const wchar_t *s), (s))
 F(int, wcsncasecmp, (const wchar_t *l, const wchar_t *r, size_t n), (l,r,n))
 F(int, wcsncasecmp_l, (const wchar_t *l, const wchar_t *r, size_t n, locale_t locale), (l,r,n,locale))
@@ -1602,6 +1728,7 @@ F(uintmax_t, wcstoumax, (const wchar_t *restrict s, wchar_t **restrict p, int ba
 F(wchar_t *, wcswcs, (const wchar_t *haystack, const wchar_t *needle), (haystack,needle))
 F(int, wcswidth, (const wchar_t *wcs, size_t n), (wcs,n))
 F(size_t, wcsxfrm, (wchar_t *restrict dest, const wchar_t *restrict src, size_t n), (dest,src,n))
+F(size_t, wcsxfrm_l, (wchar_t *restrict dest, const wchar_t *restrict src, size_t n, locale_t loc), (dest,src,n,loc))
 F(int, wctob, (wint_t c), (c))
 F(int, wctomb, (char *s, wchar_t wc), (s,wc))
 F(wctrans_t, wctrans, (const char *class), (class))
diff --git a/wrap.c b/wrap.c
index 6149907..a4144db 100644 (file)
--- a/wrap.c
+++ b/wrap.c
@@ -1,9 +1,6 @@
 #define _GNU_SOURCE
 #define _FILE_OFFSET_BITS 64
 
-#include <stdio.h>
-#include <dlfcn.h>
-
 #include "head.h"
 
 // dprintf and dlsym are not wrapped