Skip to content

Commit

Permalink
bitrot and linkat() fixes for Darwin.
Browse files Browse the repository at this point in the history
  • Loading branch information
wr-seebs committed Dec 12, 2012
1 parent 874bea3 commit 8b1afe4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.txt
Expand Up @@ -6,6 +6,8 @@
the documentation and behavior of link(2) to reflect host
OS semantics: Linux will hardlink symlinks, Darwin will only
hardlink their targets.
* (seebs) make linkat() implementation compile/run on Darwin,
fix header bitrot for Mountain Lion.

2012-08-09:
* (seebs) base_stat should be real_stat64, not stat64
Expand Down
2 changes: 1 addition & 1 deletion ports/darwin/wrapfuncs.in
Expand Up @@ -17,7 +17,7 @@ int setxattr(const char *pathname, const char *name, const void *value, size_t s
int fsetxattr(int filedes, const char *name, const void *value, size_t size, u_int32_t position, int options);
# local color UIDs
int getgrouplist(const char *name, int basegid, int *groups, int *ngroups);
int scandir(const char *path, struct dirent ***namelist, int (*filter)(struct dirent *), int (*compar)());
int scandir(const char *path, struct dirent ***namelist, int (*filter)(const struct dirent *), int (*compar)());
int getgroups(int size, gid_t *list);
int fgetgrent_r(FILE *fp, struct group *gbuf, char *buf, size_t buflen, struct group **gbufp); /* real_func=pseudo_fgetgrent_r */
int fgetpwent_r(FILE *fp, struct passwd *pbuf, char *buf, size_t buflen, struct passwd **pbufp); /* real_func=pseudo_fgetpwent_r */
Expand Down
9 changes: 5 additions & 4 deletions pseudo.h
Expand Up @@ -93,14 +93,15 @@ extern char *pseudo_version;
* terms of each other, and for instance, open(...) is the same as
* openat(AT_FDCWD, ...). If no AT_FDCWD is provided, any value that can't
* be a valid file descriptor will do. Using -2 because -1 could be
* mistaken for a failed syscall return. Similarly, any value which isn't
* zero will do to fake AT_SYMLINK_NOFOLLOW. Finally, if this happened,
* we set our own flag we can use to indicate that dummy implementations
* of the _at functions are needed.
* mistaken for a failed syscall return. AT_SYMLINK_NOFOLLOW has to be
* non-zero; AT_SYMLINK_FOLLOW has to be non-zero and different. Finally,
* if this happened, we set our own flag we can use to indicate that dummy
* implementations of the _at functions are needed.
*/
#ifndef AT_FDCWD
#define AT_FDCWD -2
#define AT_SYMLINK_NOFOLLOW 1
#define AT_SYMLINK_FOLLOW 2
#define PSEUDO_NO_REAL_AT_FUNCTIONS
#endif

Expand Down

0 comments on commit 8b1afe4

Please sign in to comment.