Skip to content

Commit ba2983e

Browse files
committed
Add the libc glue and headers definitions for the *at() syscalls.
Based on the submission by rdivacky, sponsored by Google Summer of Code 2007 Reviewed by: rwatson, rdivacky Tested by: pho
1 parent f2296b5 commit ba2983e

File tree

6 files changed

+40
-0
lines changed

6 files changed

+40
-0
lines changed

include/stdio.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,5 +449,8 @@ extern int __isthreaded;
449449
#define putchar_unlocked(x) putc_unlocked(x, stdout)
450450
#endif
451451

452+
#if __BSD_VISIBLE
453+
int renameat(int, const char *, int, const char *);
454+
#endif
452455
__END_DECLS
453456
#endif /* !_STDIO_H_ */

include/unistd.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,17 @@ void *valloc(size_t); /* obsoleted by malloc() */
559559
extern int optreset; /* getopt(3) external variable */
560560
#endif
561561
#endif /* __BSD_VISIBLE */
562+
563+
#if __BSD_VISIBLE
564+
int faccessat(int, const char *, int);
565+
int fchmodat(int, const char *, mode_t, int);
566+
int fchownat(int, const char *, uid_t, gid_t, int);
567+
int fexecve(int, char *const [], char *const []);
568+
int linkat(int, const char *, int, const char *, int);
569+
ssize_t readlinkat(int, const char *, char *, size_t);
570+
int symlinkat(const char *, int, const char *);
571+
int unlinkat(int, const char *, int);
572+
#endif /* __BSD_VISIBLE */
562573
__END_DECLS
563574

564575
#endif /* !_UNISTD_H_ */

lib/libc/sys/Symbol.map

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,24 @@ FBSD_1.0 {
334334
truncate;
335335
};
336336

337+
FBSD_1.1 {
338+
faccessat;
339+
fchmodat;
340+
fchownat;
341+
fexecve;
342+
fstatat;
343+
futimesat;
344+
linkat;
345+
mkdirat;
346+
mkfifoat;
347+
mknodat;
348+
openat;
349+
readlinkat;
350+
renameat;
351+
symlinkat;
352+
unlinkat;
353+
};
354+
337355
FBSDprivate_1.0 {
338356
___acl_aclcheck_fd;
339357
__sys___acl_aclcheck_fd;

sys/sys/fcntl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ __BEGIN_DECLS
272272
int open(const char *, int, ...);
273273
int creat(const char *, mode_t);
274274
int fcntl(int, int, ...);
275+
int openat(int, const char *, int, ...);
275276
#if __BSD_VISIBLE
276277
int flock(int, int);
277278
#endif

sys/sys/stat.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,12 @@ int mknod(const char *, mode_t, dev_t);
330330
#endif
331331
int stat(const char * __restrict, struct stat * __restrict);
332332
mode_t umask(mode_t);
333+
#if __BSD_VISIBLE
334+
int fstatat(int, const char *, struct stat *, int);
335+
int mkdirat(int, const char *, mode_t);
336+
int mkfifoat(int, const char *, mode_t);
337+
int mknodat(int, const char *, mode_t, dev_t);
338+
#endif
333339
__END_DECLS
334340
#endif /* !_KERNEL */
335341

sys/sys/time.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ int lutimes(const char *, const struct timeval *);
321321
int setitimer(int, const struct itimerval *, struct itimerval *);
322322
int settimeofday(const struct timeval *, const struct timezone *);
323323
int utimes(const char *, const struct timeval *);
324+
int futimesat(int, const char *, const struct timeval [2]);
324325
__END_DECLS
325326

326327
#endif /* !_KERNEL */

0 commit comments

Comments
 (0)