This makes this API match other kern_xxxat() functions.
Details
Details
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 38593 Build 35482: arc lint + arc unit
Event Timeline
Comment Actions
Not that it's not tested yet; advice on how to exercise this functionality is welcome.
Comment Actions
You should write (or find existing) test that uses linkat(AT_SYMLINK_FOLLOW) and linkat(0) on the symlink. In first case the link to the target should be created, in the second case perhaps error is returned (not sure which).
Comment Actions
Okay, it appears to work; I've tested with linkat_test, and also this:
#include <assert.h> #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <fcntl.h> int main(int argc, char **argv) { int error; error = linkat(AT_FDCWD, "name1", AT_FDCWD, "name2-bez-linkat", 0); perror("linkat"); error = linkat(AT_FDCWD, "name1", AT_FDCWD, "name2-z-linkat", AT_SYMLINK_FOLLOW); perror("linkat"); return (0); }
Result, in both cases (with, and without the patch), is:
lrwx------ 2 trasz trasz 11 Apr 25 14:08 name2-bez-linkat -> /etc/passwd -rw-r--r-- 2 root wheel 3801 Mar 30 14:42 name2-z-linkat