aboutsummaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* New dependenciesSimon J. Gerraty2013-10-139-0/+234
| | | | Notes: svn path=/projects/bmake/; revision=256418
* Make sure we trigger generation of headersSimon J. Gerraty2013-10-121-0/+4
| | | | Notes: svn path=/projects/bmake/; revision=256402
* Merge headSimon J. Gerraty2013-09-1124-75/+215
|\ | | | | | | Notes: svn path=/projects/bmake/; revision=255477
| * Add a mmap flag (MAP_32BIT) on 64-bit platforms to request that a mapping useJohn Baldwin2013-09-091-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an address in the first 2GB of the process's address space. This flag should have the same semantics as the same flag on Linux. To facilitate this, add a new parameter to vm_map_find() that specifies an optional maximum virtual address. While here, fix several callers of vm_map_find() to use a VMFS_* constant for the findspace argument instead of TRUE and FALSE. Reviewed by: alc Approved by: re (kib) Notes: svn path=/head/; revision=255426
| * LDNS needs OpenSSL. This wasn't a problem as long as it was only buildDag-Erling Smørgrav2013-09-081-0/+3
| | | | | | | | | | | | | | | | | | statically, since any program using it would have to link with it anyway. Approved by: re (blanket) Notes: svn path=/head/; revision=255402
| * Make libldns and libssh private.Dag-Erling Smørgrav2013-09-082-1/+2
| | | | | | | | | | | | | | Approved by: re (blanket) Notes: svn path=/head/; revision=255386
| * Update to OpenPAM Nummularia.Dag-Erling Smørgrav2013-09-071-1/+6
| |\ | | | | | | | | | Notes: svn path=/head/; revision=255376
| | * Vendor import of OpenPAM Nummularia..vendor/openpam/NUMMULARIADag-Erling Smørgrav2013-09-0786-424/+1837
| | | | | | | | | | | | | | | Notes: svn path=/vendor/openpam/dist/; revision=255365 svn path=/vendor/openpam/NUMMULARIA/; revision=255366; tag=vendor/openpam/NUMMULARIA
| * | MFV (r255364): move the code around in preparation for Nummularia.Dag-Erling Smørgrav2013-09-071-1/+1
| |\| | | | | | | | | | Notes: svn path=/head/; revision=255369
| | * Prepare for OpenPAM Nummularia by reorganizing to match its new directoryDag-Erling Smørgrav2013-09-0776-0/+0
| | | | | | | | | | | | | | | | | | | | | structure. Notes: svn path=/vendor/openpam/dist/; revision=255364
| | * Merge upstream r634:646: correctly parse mixed quoted / unquoted text.Dag-Erling Smørgrav2013-03-042-10/+3
| | | | | | | | | | | | | | | | | | | | | See http://www.openpam.org/wiki/Errata#Configurationparsing for details. Notes: svn path=/vendor/openpam/dist/; revision=247809
| | * OpenPAM Micrampelis was re-rolled due to a showstopper bug.vendor/openpam/MICRAMPELISDag-Erling Smørgrav2012-05-261-1/+3
| | | | | | | | | | | | | | | Notes: svn path=/vendor/openpam/dist/; revision=236124 svn path=/vendor/openpam/MICRAMPELIS/; revision=236125; tag=vendor/openpam/MICRAMPELIS
| * | On ARM EABI double precision floating point values are stored in theAndrew Turner2013-09-074-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | endian the CPU is in, i.e. little-endian on most ARM cores. This allows ARMv4 and ARMv5 boards to boot with the ARM EABI. Notes: svn path=/head/; revision=255361
| * | wait(2): Add some possible caveats to standards section.Jilles Tjoelker2013-09-071-4/+18
| | | | | | | | | | | | Notes: svn path=/head/; revision=255358
| * | libc: Make resolver sockets close-on-exec (SOCK_CLOEXEC).Jilles Tjoelker2013-09-061-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Although the resolver's sockets are exposed to applications via res_state, I do not expect them to pass the sockets across execve(). Notes: svn path=/head/; revision=255336
| * | libc: Use SOCK_CLOEXEC for various internal file descriptors.Jilles Tjoelker2013-09-064-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change avoids undesirably passing some internal file descriptors to a process created (fork+exec) by another thread. Kernel support for SOCK_CLOEXEC was added in r248534, March 19, 2013. Notes: svn path=/head/; revision=255328
| * | libc/stdio: Allow fopen/freopen modes in any order (except initial r/w/a).Jilles Tjoelker2013-09-061-27/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Austin Group issue #411 requires 'e' to be accepted before and after 'x', and encourages accepting the characters in any order, except the initial 'r', 'w' or 'a'. Given that glibc accepts the characters after r/w/a in any order and that diagnosing this problem may be hard, change our libc to behave that way as well. Notes: svn path=/head/; revision=255303
| * | Use Makefile.inc instead of .export.David Chisnall2013-09-062-3/+3
| | | | | | | | | | | | Notes: svn path=/head/; revision=255298
| * | Fix the namespace pollution caused by iconv.h including stdbool.hDavid Chisnall2013-09-062-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | This broke any C89 ports that defined bool themselves, including things like gcc, gtk, and so on. Notes: svn path=/head/; revision=255297
| * | Update some signal man pages for multithreading.Jilles Tjoelker2013-09-064-25/+41
| | | | | | | | | | | | Notes: svn path=/head/; revision=255296
| * | Add stub implementations of the missing C++11 math functions.David Chisnall2013-09-063-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are weak and so can be replaced by other versions in applications that choose to do so, and will give a linker warning when used so that applications that rely on the extra precision can avoid them. Note that since the C/C++ specs only guarantee that long double has precision equal to double, code that actually relies on these functions having greater precision is unportable at best and broken at worst. Notes: svn path=/head/; revision=255294
* | | Merge from headSimon J. Gerraty2013-09-05633-2995/+11145
|\| | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=255263
| * | Correct two comments.Hans Petter Selasky2013-09-051-2/+2
| | | | | | | | | | | | Notes: svn path=/head/; revision=255242
| * | Change the cap_rights_t type from uint64_t to a structure that we can extendPawel Jakub Dawidek2013-09-057-7/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in the future in a backward compatible (API and ABI) way. The cap_rights_t represents capability rights. We used to use one bit to represent one right, but we are running out of spare bits. Currently the new structure provides place for 114 rights (so 50 more than the previous cap_rights_t), but it is possible to grow the structure to hold at least 285 rights, although we can make it even larger if 285 rights won't be enough. The structure definition looks like this: struct cap_rights { uint64_t cr_rights[CAP_RIGHTS_VERSION + 2]; }; The initial CAP_RIGHTS_VERSION is 0. The top two bits in the first element of the cr_rights[] array contain total number of elements in the array - 2. This means if those two bits are equal to 0, we have 2 array elements. The top two bits in all remaining array elements should be 0. The next five bits in all array elements contain array index. Only one bit is used and bit position in this five-bits range defines array index. This means there can be at most five array elements in the future. To define new right the CAPRIGHT() macro must be used. The macro takes two arguments - an array index and a bit to set, eg. #define CAP_PDKILL CAPRIGHT(1, 0x0000000000000800ULL) We still support aliases that combine few rights, but the rights have to belong to the same array element, eg: #define CAP_LOOKUP CAPRIGHT(0, 0x0000000000000400ULL) #define CAP_FCHMOD CAPRIGHT(0, 0x0000000000002000ULL) #define CAP_FCHMODAT (CAP_FCHMOD | CAP_LOOKUP) There is new API to manage the new cap_rights_t structure: cap_rights_t *cap_rights_init(cap_rights_t *rights, ...); void cap_rights_set(cap_rights_t *rights, ...); void cap_rights_clear(cap_rights_t *rights, ...); bool cap_rights_is_set(const cap_rights_t *rights, ...); bool cap_rights_is_valid(const cap_rights_t *rights); void cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src); void cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src); bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little); Capability rights to the cap_rights_init(), cap_rights_set(), cap_rights_clear() and cap_rights_is_set() functions are provided by separating them with commas, eg: cap_rights_t rights; cap_rights_init(&rights, CAP_READ, CAP_WRITE, CAP_FSTAT); There is no need to terminate the list of rights, as those functions are actually macros that take care of the termination, eg: #define cap_rights_set(rights, ...) \ __cap_rights_set((rights), __VA_ARGS__, 0ULL) void __cap_rights_set(cap_rights_t *rights, ...); Thanks to using one bit as an array index we can assert in those functions that there are no two rights belonging to different array elements provided together. For example this is illegal and will be detected, because CAP_LOOKUP belongs to element 0 and CAP_PDKILL to element 1: cap_rights_init(&rights, CAP_LOOKUP | CAP_PDKILL); Providing several rights that belongs to the same array's element this way is correct, but is not advised. It should only be used for aliases definition. This commit also breaks compatibility with some existing Capsicum system calls, but I see no other way to do that. This should be fine as Capsicum is still experimental and this change is not going to 9.x. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=255219
| * | Add a c++/v1/tr1 include directory containing symlinks to all of the standardDavid Chisnall2013-09-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | headrs. Lots of third-party code expects to find C++03 headers under tr1 because that's where GNU decided to hide them. This should fix ports that expect them there. MFC after: 1 week Notes: svn path=/head/; revision=255206
| * | Connect libexecinfo to the buildEd Maste2013-09-031-0/+1
| | | | | | | | | | | | | | | | | | | | | Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=255180
| * | Don't install private libexecinfo headersEd Maste2013-09-031-1/+1
| | | | | | | | | | | | Notes: svn path=/head/; revision=255175
| * | Document SIGLIBRT in signal(3); take a stab at the signal description asRobert Watson2013-09-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | the original committer didn't provide one. MFC after: 3 days Notes: svn path=/head/; revision=255171
| * | libexecinfo compatibility with devel/libexecinfo portEd Maste2013-09-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Match shlib number 2. Add libelf dependency Suggested by: bapt[1] Notes: svn path=/head/; revision=255146
| * | system(): Restore behaviour for SIGINT and SIGQUIT.Jilles Tjoelker2013-09-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As mentioned in r16117 and the book "Advanced Programming in the Unix Environment" by W. Richard Stevens, we should ignore SIGINT and SIGQUIT before forking, since it is not guaranteed that the parent process starts running soon enough. To avoid calling sigaction() in the vforked child, instead block SIGINT and SIGQUIT before vfork() and keep the sigaction() to ignore after vfork(). The FreeBSD kernel discards ignored signals, even if they are blocked; therefore, it is not necessary to unblock SIGINT and SIGQUIT earlier. Notes: svn path=/head/; revision=255129
| * | libc: Always use our own copy of sys_errlist and sys_nerr (.so only).Jilles Tjoelker2013-08-314-4/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ensures strerror() and friends continue to work correctly even if a (non-PIE) executable linked against an older libc imports sys_errlist (which causes sys_errlist to refer to the executable's copy with a size fixed when that executable was linked). The executable's use of sys_errlist remains broken because it uses the current value of sys_nerr and may access past the bounds of the array. Different from the message "Using sys_errlist from executables is not ABI-stable" on freebsd-arch, this change does not affect the static library. There seems no reason to prevent overriding the error messages in the static library. Notes: svn path=/head/; revision=255108
| * | Add support to the ARM platform specific section types.Andrew Turner2013-08-311-1/+9
| | | | | | | | | | | | Notes: svn path=/head/; revision=255105
| * | Unconditionally compile the __sync_* atomics support functions into compiler-rtDavid Chisnall2013-08-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for ARM. This is quite ugly, because it has to work around a clang bug that does not allow built-in functions to be defined, even when they're ones that are expected to be built as part of a library. Reviewed by: ed Notes: svn path=/head/; revision=255092
| * | The round of expand_number() cleanups.Sergey Kandaurov2013-08-301-29/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Fix range error checking to detect overflow when uint64_t < uintmax_t. o Remove a non-functional check for no valid digits as pointed out by Bruce. o Remove a rather pointless comment describing what the function does. o Clean up a bunch of style bugs. Brucified by: bde Notes: svn path=/head/; revision=255069
| * | libutil: Use O_CLOEXEC for internal file descriptors from open().Jilles Tjoelker2013-08-285-9/+12
| | | | | | | | | | | | Notes: svn path=/head/; revision=255007
| * | Xref capsicum(4) and procdesc(4) from pdfork(2).Robert Watson2013-08-281-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | Suggested by: sbruno MFC after: 3 days Notes: svn path=/head/; revision=255002
| * | * Whitespace.Steve Kargl2013-08-281-1/+1
| | | | | | | | | | | | Notes: svn path=/head/; revision=254994
| * | wordexp(): Avoid leaking the pipe file descriptors to a parallel fork/exec.Jilles Tjoelker2013-08-271-4/+4
| | | | | | | | | | | | | | | | | | | | | This uses the new pipe2() system call added on May 1 (r250159). Notes: svn path=/head/; revision=254977
| * | * s_erf.c:Steve Kargl2013-08-272-99/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | . Use integer literal constants instead of double literal constants. * s_erff.c: . Use integer literal constants instead of casting double literal constants to float. . Update the threshold values from those carried over from erf() to values appropriate for float. . New sets of polynomial coefficients for the rational approximations. These coefficients have little, but positive, effect on the maximum error in ULP in the four intervals, but do improve the overall speed of execution. . Remove redundant GET_FLOAT_WORD(ix,x) as hx already contained the contents that is packed into ix. . Update the mask that is used to zero-out lower-order bits in x in the intervals [1.25, 2.857143] and [2.857143, 12]. In tests on amd64, this change improves the maximum error in ULP from 6.27739 and 63.8095 to 3.16774 and 2.92095 on these intervals for erffc(). Reviewed by: bde Notes: svn path=/head/; revision=254969
| * | Make the PAM password strength checking module WARNS=2 safe.Will Andrews2013-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lib/libpam/modules/pam_passwdqc/Makefile: Bump WARNS to 2. contrib/pam_modules/pam_passwdqc/pam_passwdqc.c: Bump _XOPEN_SOURCE and _XOPEN_VERSION from 500 to 600 so that vsnprint() is declared. Use the two new union types (pam_conv_item_t and pam_text_item_t) to resolve strict aliasing violations caused by casts to comply with the pam_get_item() API taking a "const void **" for all item types. Warnings are generated for casts that create "type puns" (pointers of conflicting sized types that are set to access the same memory location) since these pointers may be used in ways that violate C's strict aliasing rules. Casts to a new type must be performed through a union in order to be compliant, and access must be performed through only one of the union's data types during the lifetime of the union instance. Handle strict-aliasing warnings through pointer assignments, which drastically simplifies this change. Correct a CLANG "printf-like function with more arguments than format" error. Submitted by: gibbs Sponsored by: Spectra Logic Notes: svn path=/head/; revision=254960
| * | Add libexecinfo MakefileEd Maste2013-08-231-0/+19
| | | | | | | | | | | | | | | | | | | | | Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=254709
| * | libc: Access some unexported variables more efficiently (related to stdio).Jilles Tjoelker2013-08-231-2/+2
| | | | | | | | | | | | Notes: svn path=/head/; revision=254706
| * | libc: Make various internal file descriptors from fopen() close-on-exec.Jilles Tjoelker2013-08-2313-21/+21
| | | | | | | | | | | | Notes: svn path=/head/; revision=254700
| * | Remove EOL whitespace.Joel Dahl2013-08-221-1/+1
| | | | | | | | | | | | Notes: svn path=/head/; revision=254660
| * | Update Bind to 9.9.3-P2Erwin Lansing2013-08-225-88/+74
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notable new features: * Elliptic Curve Digital Signature Algorithm keys and signatures in DNSSEC are now supported per RFC 6605. [RT #21918] * Introduces a new tool "dnssec-verify" that validates a signed zone, checking for the correctness of signatures and NSEC/NSEC3 chains. [RT #23673] * BIND now recognizes the TLSA resource record type, created to support IETF DANE (DNS-based Authentication of Named Entities) [RT #28989] * The new "inline-signing" option, in combination with the "auto-dnssec" option that was introduced in BIND 9.7, allows named to sign zones completely transparently. Approved by: delphij (mentor) MFC after: 3 days Sponsored by: DK Hostmaster A/S Notes: svn path=/head/; revision=254651
| | * | Vendor import of Bind 9.9.3-P2vendor/bind9/9.9.3-P2Erwin Lansing2013-08-14188-1454/+8393
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Approved by: delphij (mentor, implicit) Sponsored by: DK Hostmaster A/S Notes: svn path=/vendor/bind9/dist/; revision=254322 svn path=/vendor/bind9/9.9.3-P2/; revision=254323; tag=vendor/bind9/9.9.3-P2
| * | | Even though it doesn't really make sense in the context of a CONNECTDag-Erling Smørgrav2013-08-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | request, RFC 2616 14.23 mandates the presence of the Host: header in all HTTP 1.1 requests. PR: kern/181445 Submitted by: Kimo <kimor79@yahoo.com> MFC after: 3 days Notes: svn path=/head/; revision=254650
| * | | Expand the use of stat(2) flags to allow storing some Windows/DOSKenneth D. Merry2013-08-212-14/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and CIFS file attributes as BSD stat(2) flags. This work is intended to be compatible with ZFS, the Solaris CIFS server's interaction with ZFS, somewhat compatible with MacOS X, and of course compatible with Windows. The Windows attributes that are implemented were chosen based on the attributes that ZFS already supports. The summary of the flags is as follows: UF_SYSTEM: Command line name: "system" or "usystem" ZFS name: XAT_SYSTEM, ZFS_SYSTEM Windows: FILE_ATTRIBUTE_SYSTEM This flag means that the file is used by the operating system. FreeBSD does not enforce any special handling when this flag is set. UF_SPARSE: Command line name: "sparse" or "usparse" ZFS name: XAT_SPARSE, ZFS_SPARSE Windows: FILE_ATTRIBUTE_SPARSE_FILE This flag means that the file is sparse. Although ZFS may modify this in some situations, there is not generally any special handling for this flag. UF_OFFLINE: Command line name: "offline" or "uoffline" ZFS name: XAT_OFFLINE, ZFS_OFFLINE Windows: FILE_ATTRIBUTE_OFFLINE This flag means that the file has been moved to offline storage. FreeBSD does not have any special handling for this flag. UF_REPARSE: Command line name: "reparse" or "ureparse" ZFS name: XAT_REPARSE, ZFS_REPARSE Windows: FILE_ATTRIBUTE_REPARSE_POINT This flag means that the file is a Windows reparse point. ZFS has special handling code for reparse points, but we don't currently have the other supporting infrastructure for them. UF_HIDDEN: Command line name: "hidden" or "uhidden" ZFS name: XAT_HIDDEN, ZFS_HIDDEN Windows: FILE_ATTRIBUTE_HIDDEN This flag means that the file may be excluded from a directory listing if the application honors it. FreeBSD has no special handling for this flag. The name and bit definition for UF_HIDDEN are identical to the definition in MacOS X. UF_READONLY: Command line name: "urdonly", "rdonly", "readonly" ZFS name: XAT_READONLY, ZFS_READONLY Windows: FILE_ATTRIBUTE_READONLY This flag means that the file may not written or appended, but its attributes may be changed. ZFS currently enforces this flag, but Illumos developers have discussed disabling enforcement. The behavior of this flag is different than MacOS X. MacOS X uses UF_IMMUTABLE to represent the DOS readonly permission, but that flag has a stronger meaning than the semantics of DOS readonly permissions. UF_ARCHIVE: Command line name: "uarch", "uarchive" ZFS_NAME: XAT_ARCHIVE, ZFS_ARCHIVE Windows name: FILE_ATTRIBUTE_ARCHIVE The UF_ARCHIVED flag means that the file has changed and needs to be archived. The meaning is same as the Windows FILE_ATTRIBUTE_ARCHIVE attribute, and the ZFS XAT_ARCHIVE and ZFS_ARCHIVE attribute. msdosfs and ZFS have special handling for this flag. i.e. they will set it when the file changes. sys/param.h: Bump __FreeBSD_version to 1000047 for the addition of new stat(2) flags. chflags.1: Document the new command line flag names (e.g. "system", "hidden") available to the user. ls.1: Reference chflags(1) for a list of file flags and their meanings. strtofflags.c: Implement the mapping between the new command line flag names and new stat(2) flags. chflags.2: Document all of the new stat(2) flags, and explain the intended behavior in a little more detail. Explain how they map to Windows file attributes. Different filesystems behave differently with respect to flags, so warn the application developer to take care when using them. zfs_vnops.c: Add support for getting and setting the UF_ARCHIVE, UF_READONLY, UF_SYSTEM, UF_HIDDEN, UF_REPARSE, UF_OFFLINE, and UF_SPARSE flags. All of these flags are implemented using attributes that ZFS already supports, so the on-disk format has not changed. ZFS currently doesn't allow setting the UF_REPARSE flag, and we don't really have the other infrastructure to support reparse points. msdosfs_denode.c, msdosfs_vnops.c: Add support for getting and setting UF_HIDDEN, UF_SYSTEM and UF_READONLY in MSDOSFS. It supported SF_ARCHIVED, but this has been changed to be UF_ARCHIVE, which has the same semantics as the DOS archive attribute instead of inverse semantics like SF_ARCHIVED. After discussion with Bruce Evans, change several things in the msdosfs behavior: Use UF_READONLY to indicate whether a file is writeable instead of file permissions, but don't actually enforce it. Refuse to change attributes on the root directory, because it is special in FAT filesystems, but allow most other attribute changes on directories. Don't set the archive attribute on a directory when its modification time is updated. Windows and DOS don't set the archive attribute in that scenario, so we are now bug-for-bug compatible. smbfs_node.c, smbfs_vnops.c: Add support for UF_HIDDEN, UF_SYSTEM, UF_READONLY and UF_ARCHIVE in SMBFS. This is similar to changes that Apple has made in their version of SMBFS (as of smb-583.8, posted on opensource.apple.com), but not quite the same. We map SMB_FA_READONLY to UF_READONLY, because UF_READONLY is intended to match the semantics of the DOS readonly flag. The MacOS X code maps both UF_IMMUTABLE and SF_IMMUTABLE to SMB_FA_READONLY, but the immutable flags have stronger meaning than the DOS readonly bit. stat.h: Add definitions for UF_SYSTEM, UF_SPARSE, UF_OFFLINE, UF_REPARSE, UF_ARCHIVE, UF_READONLY and UF_HIDDEN. The definition of UF_HIDDEN is the same as the MacOS X definition. Add commented-out definitions of UF_COMPRESSED and UF_TRACKED. They are defined in MacOS X (as of 10.8.2), but we do not implement them (yet). ufs_vnops.c: Add support for getting and setting UF_ARCHIVE, UF_HIDDEN, UF_OFFLINE, UF_READONLY, UF_REPARSE, UF_SPARSE, and UF_SYSTEM in UFS. Alphabetize the flags that are supported. These new flags are only stored, UFS does not take any action if the flag is set. Sponsored by: Spectra Logic Reviewed by: bde (earlier version) Notes: svn path=/head/; revision=254627
| * | | Reset errno before strtoumax() call to properly detect ERANGE.Sergey Kandaurov2013-08-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Restore saved errno if strtoumax() call is successful. Reported by: ache Reviewed by: jilles MFC after: 1 week Notes: svn path=/head/; revision=254621
| * | | Check strtoumax(3) for ERANGE in case of non-prefixed string.Sergey Kandaurov2013-08-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OK'd by: silence on current@ MFC after: 1 week Notes: svn path=/head/; revision=254600