LSB 3.1 Specification Errata, TC #1 Hand-updated errata reflecting comments from LSB Sprint Last Updated Mon May 14 2007 ========================================================================== Specification: LSB Core Generic Specification: LSB Core IA32, IA64, AMD64, PPC32, PPC64, S390, S390X Edition of Specification: 3.1 Type: Editorial Status: Unapproved, new text Bug reference: http://bugs.linuxbase.org/show_bug.cgi?id=1291 Rationale: the referenced underlying specification for the matherr() function was incorrect. In one instance the referenced specification needed to be added to the list. Additionaly, matherr is found to have been included in error, and is marked deprecated. In LSB Core Generic: Section : 13.6.1.1. Interfaces for Math, change matherr [ISOC99] to matherr [SVID.3] matherr [SVID.3] (deprecated) Section : A.4 (Appendix A) Add to the list of Standards: SVID Issue 3 [SVID.3] In Table A-5, libm Function Interfaces, change matherr(GLIBC_2.0)[ISOC99] to matherr(GLIBC_2.0)[SVID.3] matherr(GLIBC_2.0)[SVID.3] (deprecated) === In LSB Core IA32 change 11.4.1.1. Interfaces for Math matherr(GLIBC_2.0) [ISOC99] to matherr(GLIBC_2.0) [SVID.3] matherr(GLIBC_2.0) [SVID.3] (deprecated) === In LSB Core IA64 change 11.4.1.1. Interfaces for Math matherr(GLIBC_2.2) [ISOC99] to matherr(GLIBC_2.2) [SVID.3] matherr(GLIBC_2.2) [SVID.3] (deprecated) === In LSB Core PPC32 change 11.4.1.1. Interfaces for Math matherr(GLIBC_2.0) [ISOC99] to matherr(GLIBC_2.0) [SVID.3] matherr(GLIBC_2.0) [SVID.3] (deprecated) === In LSB Core PPC64 change 11.4.1.1. Interfaces for Math matherr(GLIBC_2.3) [ISOC99] to matherr(GLIBC_2.3) [SVID.3] matherr(GLIBC_2.3) [SVID.3] (deprecated) === In LSB Core S390 change 11.4.1.1. Interfaces for Math matherr(GLIBC_2.0) [ISOC99] to matherr(GLIBC_2.0) [SVID.3] matherr(GLIBC_2.0) [SVID.3] (deprecated) === In LSB Core S390X change 11.4.1.1. Interfaces for Math matherr(GLIBC_2.2) [ISOC99] to matherr(GLIBC_2.2) [SVID.3] matherr(GLIBC_2.2) [SVID.3] (deprecated) === In LSB Core AMD64 change 11.4.1.1. Interfaces for Math matherr(GLIBC_2.2.5) [ISOC99] to matherr(GLIBC_2.2.5) [SVID.3] matherr(GLIBC_2.2.5) [SVID.3] (deprecated) ========================================================================== Specification: LSB Core Generic Edition of Specification: 3.1 Type: Editorial Status: Unapproved, new text Bug reference: http://bugs.linuxbase.org/show_bug.cgi?id=1329 Rationale: strnlen wording is not clear; references to string where the array of characters need not be null-terminated. Section: 13.5. Interface Definitions for libc Interface strnlen, section Description, Change: strnlen() returns the number of characters in the string s, not including the terminating \0 character, but at most maxlen. In doing this, strnlen() looks only at the first maxlen characters at s and never beyond s + maxlen. To: The strnlen() function shall compute the number of bytes in the array to which s points, stopping at maxlen bytes. A null byte and any bytes following it are not counted. The strnlen() function shall compute the smaller of the number of bytes in the array to which s points, not including the terminating null byte, or the value of the maxlen argument. The strnlen() function shall never examine more than maxlen bytes of the array pointed to by s. Interface strnlen, section Return Value, Change: strnlen() returns strlen(s), if that is less than maxlen, or maxlen if there is no \0 character among the first maxlen characters pointed to by s. To: The strnlen() function shall return the length of s if that is less than maxlen, or maxlen if there is no null byte in the first maxlen bytes. The strnlen() function shall return an integer containing the smaller of either the length of the array pointed to by s or maxlen. ========================================================================== Specification: LSB Core Generic Edition of Specification: 3.1 Type: Error Status: Unapproved, new text Bug reference: http://bugs.linuxbase.org/show_bug.cgi?id=1334 Rationale: several error conditions for flock() were not described Section: 13.4. Data Definitions for libc Interface flock, section Errors, add: EBADF fd is not a not an open file descriptor. EINTR While waiting to acquire a lock, the call was interrupted by delivery of a signal caught by a handler. EINVAL The operation is invalid. EWOULDBLOCK The implementation ran out of memory for allocating lock records. ENOLCK The implementation ran out of memory for allocating lock records. Note to reviewers: the EWOULDBLOCK error was already present in the specification text and so is not added here. ========================================================================== Specification: LSB Core Generic Edition of Specification: 3.1 Type: Editorial Status: Unapproved, new text Bug reference: http://bugs.linuxbase.org/show_bug.cgi?id=1361 Rationale: the referenced underlying specification for the endutent() function was incorrect and the definition of the interface was omitted. Section 13.3.14.1. Interfaces for System Database Interface, change endutent [SUSv2] to endutent [LSB] Section 13.5, Interface Definitions for libc, Contents, add endutent -- access utmp file entries Section 13.5, Interface Definitions for libc, add endutent Name endutent -- access utmp file entries Synopsis #include void endutent(void); Description endutent() closes the utmp file. It should be called when the user code is done accessing the file with the other functions. The endutent() function may be called to close the user accounting database when processing is complete. Table A-1. libc Function Interfaces, change endutent(GLIBC_2.0)[SUSv2] to endutent(GLIBC_2.0)[LSB] ========================================================================== Specification: LSB Core IA64, AMD64 Edition of Specification: 3.1 Type: Editorial Status: Unapproved, new text Bug reference: http://bugs.linuxbase.org/show_bug.cgi?id=1377 Rationale: the reference specification for __fpclassifyl was incorrect. Since the reference specification is this document, the specification text needed to be added. After the change, this now matches how LSB Core IA32 appears. In Specification LSB Core IA64: Section 11.4.1.1 Interfaces for Math, change __fpclassifyl(GLIBC_2.2) [ISOC99] to __fpclassifyl(GLIBC_2.2) [LSB] Add new section: Interface Definitions for libm Table of Contents __fpclassifyl -- Classify real floating type The interfaces defined on the following pages are included in libm and are defined by this specification. Unless otherwise noted, these interfaces shall be included in the source standard. Other interfaces listed in Section [XX] shall behave as described in the referenced base document. Other interfaces listed in Section 11.4 shall behave as described in the referenced base document. __fpclassify __fpclassifyl Name __fpclassifyl -- Classify real floating type Synopsis int __fpclassifyl(long double arg); Description __fpclassifyl() has the same specification as fpclassify() in ISO POSIX (2003), except that the argument type for __fpclassifyl() is known to be long double. __fpclassifyl() is not in the source standard; it is only in the binary standard. Section A.2 libm, add to the list of Standards: This Specification [LSB] In Table A-2, libm Function Interfaces, change __fpclassifyl[ISOC99] to __fpclassifyl[LSB] === In Specification LSB Core AMD64: Section 11.4.1.1 Interfaces for Math, change __fpclassifyl(GLIBC_2.2) [ISOC99] to __fpclassifyl(GLIBC_2.2) [LSB] Add new section: Interface Definitions for libm Table of Contents __fpclassifyl -- Classify real floating type The interfaces defined on the following pages are included in libm and are defined by this specification. Unless otherwise noted, these interfaces shall be included in the source standard. Other interfaces listed in Section [XX] shall behave as described in the referenced base document. Other interfaces listed in Section 11.4 shall behave as described in the referenced base document. __fpclassify __fpclassifyl Name __fpclassifyl -- Classify real floating type Synopsis int __fpclassifyl(long double arg); Description __fpclassifyl() has the same specification as fpclassify() in ISO POSIX (2003), except that the argument type for __fpclassifyl() is known to be long double. __fpclassifyl() is not in the source standard; it is only in the binary standard. Section A.2 libm, add to the list of Standards: This Specification [LSB] In Table A-2, libm Function Interfaces, change __fpclassifyl[ISOC99] to __fpclassifyl[LSB] ========================================================================== Specification: LSB Core Generic Specification: LSB Core IA32, IA64, AMD64, PPC32, PPC64, S390, S390X Edition of Specification: 3.1 Type: Editorial Status: Unapproved, new text Bug reference: http://bugs.linuxbase.org/show_bug.cgi?id=1525 Rationale: the statfs and fstatfs functions were marked as obsolete in LSB 1.3 and removed at 2.0. However, since these interfaces provide the only method for discovering the file system type, their removal was regarded as premature, and they have been reinstated (together with their obsolete status) until such time as there is a better alternative in widespread use. In LSB Core Generic: Section : 13.3.2.1. Interfaces for System Calls, insert fstatfs [LSB] statfs [LSB] Section : 13.3.16.1. Interfaces for Large File Support, insert fstatfs64 [LSB] statfs64 [LSB] Section : 13.4 Data Defintions for libc, add 13.4.60. sys/statfs.h #define NFS_SUPER_MAGIC 0x6969 struct statfs { int f_type; int f_bsize; fsblkcnt_t f_blocks; fsblkcnt_t f_bfree; fsblkcnt_t f_bavail; fsblkcnt_t f_files; fsblkcnt_t f_ffree; fsid_t f_fsid; int f_namelen; int f_spare[6]; }; struct statfs64 { int f_type; int f_bsize; fsblkcnt64_t f_blocks; fsblkcnt64_t f_bfree; fsblkcnt64_t f_bavail; fsblkcnt64_t f_files; fsblkcnt64_t f_ffree; fsid_t f_fsid; int f_namelen; int f_spare[6]; }; extern int fstatfs64(int, struct statfs64 *); extern int statfs64(const char *, struct stat64 *); extern int fstatfs(int, struct statfs *); extern int statfs(const char *, struct statfs *); Section : 13.5. Interface Definitions for libc, add fstatfs -- (deprecated) fstatfs64 -- (deprecated) statfs -- (deprecated) statfs64 -- (deprecated) and add: fstatfs Name fstatfs -- (deprecated) Synopsis #include int fstatfs(int fd, struct statfs * buf); Description The fstatfs() function returns information about a mounted file system. The file system is identified by fd, a file descriptor of an open file within the mounted filesystem. The results are placed in the structure pointed to by buf. Fields that are undefined for a particular file system shall be set to 0. Note: Application developers should use the fstatvfs() function to obtain general file system information. Applications should only use the fstatfs() function if they must determine the file system type, which need not be provided by fstatvfs(). This specification does not define the semantics of different file system types. However, the commonly used NFS file system type can be identified using the NFS_SUPER_MAGIC value defined in to recognize that the file resided on a remote NFS file system. Return Value On success, the fstatfs() function shall return 0 and sed the fields of the structure idenfitied by buf accordingly. On error, the fstatfs() function shall return -1 and set errno accordingly. Errors EBADF fd is not a valid open file descriptor. EFAULT buf points to an invalid address. EIO An I/O error occurred while reading from or writing to the file system. ENOSYS The filesystem fd is open on does not support statfs(). fstatfs64 Name fstatfs64 -- (deprecated) Synopsis #include int fstatfs64(int fd, struct statfs64 * buf); Description The fstatfs64() function returns information about a mounted file system. The file system is identified by fd, a file descriptor of an open file within the mounted filesystem. The results are placed in the structure pointed to by buf. Fields that are undefined for a particular file system shall be set to 0. fstatfs64() is the 64-bit version of fstatfs(). Note: Application developers should use the fstatvfs64() function to obtain general file system information. Applications should only use the fstatfs64() function if they must determine the file system type, which need not be provided by fstatvfs64(). This specification does not define the semantics of different file system types. However, the commonly used NFS file system type can be identified using the NFS_SUPER_MAGIC value defined in to recognize that the file resided on a remote NFS file system. Return Value On success, the fstatfs64() function shall return 0 and sed the fields of the structure idenfitied by buf accordingly. On error, the fstatfs64() function shall return -1 and set errno accordingly. Errors See fstatfs(). statfs Name statfs -- (deprecated) Synopsis #include int statfs(const char *path, (struct statfs * buf)); Description The statfs() function returns information about a mounted file system. The file system is identified by path, a path name of a file within the mounted filesystem. The results are placed in the structure pointed to by Fields that are undefined for a particular file system shall be set to 0. Note: Application developers should use the statvfs() function to obtain general file system information. Applications should only use the statfs() function if they must determine the file system type, which need not be provided by statvfs(). This specification does not define the semantics of different file system types. However, the commonly used NFS file system type can be identified using the NFS_SUPER_MAGIC value defined in to recognize that the file resided on a remote NFS file system. Return Value On success, the statfs() function shall return 0 and sed the fields of the structure idenfitied by buf accordingly. On error, the statfs() function shall return -1 and set errno accordingly. Errors ENOTDIR A component of the path prefix of path is not a directory. ENAMETOOLONG path is too long. ENOENT The file referred to by path does not exist. EACCES Search permission is denied for a component of the path prefix of path. ELOOP Too many symbolic links were encountered in translating path. EFAULT buf or path points to an invalid address. EIO An I/O error occurred while reading from or writing to the file system. ENOMEM Insufficient kernel memory was available. ENOSYS The filesystem path is on does not support statfs(). statfs64 Name statfs64 -- (deprecated) Synopsis #include int statfs64(const char * path, (struct statfs64 * buf)); Description The statfs64() function returns information about a mounted file system. The file system is identified by path, a path name of a file within the mounted filesystem. The results are placed in the structure pointed to by buf. statfs64() is the 64-bit version of statfs(). Fields that are undefined for a particular file system shall be set to 0. Note: Application developers should use the statvfs64() function to obtain general file system information. Applications should only use the statfs64() function if they must determine the file system type, which need not be provided by statvfs64(). This specification does not define the semantics of different file system types. However, the commonly used NFS file system type can be identified using the NFS_SUPER_MAGIC value defined in to recognize that the file resided on a remote NFS file system. Return Value On success, the statfs64() function shall return 0 and sed the fields of the structure idenfitied by buf accordingly. On error, the statfs64() function shall return -1 and set errno accordingly. Errors See fstatfs(). == In LSB Core IA32 Section : 11.2.2.1. Interfaces for System Calls, insert fstatfs(GLIBC_2.0) [LSB] statfs(GLIBC_2.0) [LSB] Section : 11.2.16.1. Interfaces for Large File Support, insert fstatfs64(GLIBC_2.1) [LSB] statfs64(GLIBC_2.1) [LSB] == In LSB Core IA64 Section : 11.2.2.1. Interfaces for System Calls, insert fstatfs(GLIBC_2.2) [LSB] statfs(GLIBC_2.2) [LSB] Section : 11.2.16.1. Interfaces for Large File Support, insert fstatfs64(GLIBC_2.2) [LSB] statfs64(GLIBC_2.2) [LSB] == In LSB Core AMD64 Section : 11.2.2.1. Interfaces for System Calls, insert fstatfs(GLIBC_2.2.5) [LSB] statfs(GLIBC_2.2.5) [LSB] Section : 11.2.16.1. Interfaces for Large File Support, insert fstatfs64(GLIBC_2.2.5) [LSB] statfs64(GLIBC_2.2.5) [LSB] == In LSB Core PPC32 Section : 11.2.2.1. Interfaces for System Calls, insert fstatfs(GLIBC_2.0) [LSB] statfs(GLIBC_2.0) [LSB] Section : 11.2.16.1. Interfaces for Large File Support, insert fstatfs64(GLIBC_2.1) [LSB] statfs64(GLIBC_2.1) [LSB] == In LSB Core PPC64 Section : 11.2.2.1. Interfaces for System Calls, insert fstatfs(GLIBC_2.3) [LSB] statfs(GLIBC_2.3) [LSB] Section : 11.2.16.1. Interfaces for Large File Support, insert fstatfs64(GLIBC_2.3) [LSB] statfs64(GLIBC_2.3) [LSB] == In LSB Core S390 Section : 11.2.2.1. Interfaces for System Calls, insert fstatfs(GLIBC_2.0) [LSB] statfs(GLIBC_2.0) [LSB] Section : 11.2.16.1. Interfaces for Large File Support, insert fstatfs64(GLIBC_2.1) [LSB] statfs64(GLIBC_2.1) [LSB] == In LSB Core S390X Section : 11.2.2.1. Interfaces for System Calls, insert fstatfs(GLIBC_2.2) [LSB] statfs(GLIBC_2.2) [LSB] Section : 11.2.16.1. Interfaces for Large File Support, insert fstatfs64(GLIBC_2.2) [LSB] statfs64(GLIBC_2.2) [LSB]