diff options
Diffstat (limited to 'man/man2')
31 files changed, 212 insertions, 211 deletions
diff --git a/man/man2/add_key.2 b/man/man2/add_key.2 index b316c15c21..a4515efc51 100644 --- a/man/man2/add_key.2 +++ b/man/man2/add_key.2 @@ -15,7 +15,7 @@ Standard C library .B #include <keyutils.h> .P .BI "key_serial_t add_key(const char *" type ", const char *" description , -.BI " const void " payload [. plen "], size_t " plen , +.BI " const void " payload [. size "], size_t " size , .BI " key_serial_t " keyring ");" .fi .P @@ -29,8 +29,8 @@ and .IR description , instantiates it with the .I payload -of length -.IR plen , +of size +.IR size , attaches it to the nominated .IR keyring , and returns the key's serial number. @@ -102,7 +102,7 @@ keys of any type. If this interface is used to create a keyring, then .I payload should be NULL and -.I plen +.I size should be zero. .TP .I \[dq]user\[dq] diff --git a/man/man2/alloc_hugepages.2 b/man/man2/alloc_hugepages.2 index 8e4b7ee1bd..ab8aed8014 100644 --- a/man/man2/alloc_hugepages.2 +++ b/man/man2/alloc_hugepages.2 @@ -7,11 +7,11 @@ alloc_hugepages, free_hugepages \- allocate or free huge pages .SH SYNOPSIS .nf -.BI "void *syscall(SYS_alloc_hugepages, int " key ", void " addr [. len "], \ -size_t " len , +.BI "void *syscall(SYS_alloc_hugepages, int " key ", void " addr [. size "], \ +size_t " size , .BI " int " prot ", int " flag ); .\" asmlinkage unsigned long sys_alloc_hugepages(int key, unsigned long addr, -.\" unsigned long len, int prot, int flag); +.\" unsigned long size, int prot, int flag); .BI "int syscall(SYS_free_hugepages, void *" addr ); .\" asmlinkage int sys_free_hugepages(unsigned long addr); .fi @@ -65,8 +65,8 @@ is a hint, that the kernel may or may not follow. Addresses must be properly aligned. .P The -.I len -argument is the length of the required segment. +.I size +argument is the size of the required segment. It must be a multiple of the huge page size. .P The diff --git a/man/man2/cacheflush.2 b/man/man2/cacheflush.2 index 2a48dccd28..f9fb21c319 100644 --- a/man/man2/cacheflush.2 +++ b/man/man2/cacheflush.2 @@ -80,12 +80,12 @@ Linux provides this system call, with different arguments: M68K: .nf .BI "int cacheflush(unsigned long " addr ", int " scope ", int " cache , -.BI " unsigned long " len ); +.BI " unsigned long " size ); .fi .TP SH: .nf -.BI "int cacheflush(unsigned long " addr ", unsigned long " len ", int " op ); +.BI "int cacheflush(unsigned long " addr ", unsigned long " size ", int " op ); .fi .TP NDS32: diff --git a/man/man2/copy_file_range.2 b/man/man2/copy_file_range.2 index 447e787cf7..e2c024a959 100644 --- a/man/man2/copy_file_range.2 +++ b/man/man2/copy_file_range.2 @@ -16,7 +16,7 @@ Standard C library .P .BI "ssize_t copy_file_range(int " fd_in ", off_t *_Nullable " off_in , .BI " int " fd_out ", off_t *_Nullable " off_out , -.BI " size_t " len ", unsigned int " flags ); +.BI " size_t " size ", unsigned int " flags ); .fi .SH DESCRIPTION The @@ -25,7 +25,7 @@ system call performs an in-kernel copy between two file descriptors without the additional cost of transferring data from the kernel to user space and then back into the kernel. It copies up to -.I len +.I size bytes of data from the source file descriptor .I fd_in to the target file descriptor @@ -73,7 +73,7 @@ and currently must be set to 0. Upon successful completion, .BR copy_file_range () will return the number of bytes copied between files. -This could be less than the length originally requested. +This could be less than the size originally requested. If the file offset of .I fd_in is at or past the end of file, no bytes are copied, and @@ -259,7 +259,7 @@ int main(int argc, char *argv[]) { int fd_in, fd_out; - off_t len, ret; + off_t size, ret; struct stat stat; \& if (argc != 3) { @@ -278,7 +278,7 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } \& - len = stat.st_size; + size = stat.st_size; \& fd_out = open(argv[2], O_CREAT | O_WRONLY | O_TRUNC, 0644); if (fd_out == \-1) { @@ -287,14 +287,14 @@ main(int argc, char *argv[]) } \& do { - ret = copy_file_range(fd_in, NULL, fd_out, NULL, len, 0); + ret = copy_file_range(fd_in, NULL, fd_out, NULL, size, 0); if (ret == \-1) { perror("copy_file_range"); exit(EXIT_FAILURE); } \& - len \-= ret; - } while (len > 0 && ret > 0); + size \-= ret; + } while (size > 0 && ret > 0); \& close(fd_in); close(fd_out); diff --git a/man/man2/fallocate.2 b/man/man2/fallocate.2 index 475c8422c2..059044a0f5 100644 --- a/man/man2/fallocate.2 +++ b/man/man2/fallocate.2 @@ -18,7 +18,7 @@ Standard C library .B #include <fcntl.h> .P .BI "int fallocate(int " fd ", int " mode ", off_t " offset \ -", off_t " len ");" +", off_t " size ); .fi .SH DESCRIPTION This is a nonportable, Linux-specific system call. @@ -33,7 +33,7 @@ for the file referred to by for the byte range starting at .I offset and continuing for -.I len +.I size bytes. .P The @@ -48,16 +48,16 @@ is zero) of allocates the disk space within the range specified by .I offset and -.IR len . +.IR size . The file size (as reported by .BR stat (2)) will be changed if -.IR offset + len +.IR offset + size is greater than the file size. Any subregion within the range specified by .I offset and -.I len +.I size that did not contain data before the call will be initialized to zero. This default behavior closely resembles the behavior of the .BR posix_fallocate (3) @@ -67,7 +67,7 @@ and is intended as a method of optimally implementing that function. After a successful call, subsequent writes into the range specified by .I offset and -.I len +.I size are guaranteed not to fail because of lack of disk space. .P If the @@ -76,7 +76,7 @@ flag is specified in .IR mode , the behavior of the call is similar, but the file size will not be changed even if -.IR offset + len +.IR offset + size is greater than the file size. Preallocating zeroed blocks beyond the end of the file in this manner is useful for optimizing append workloads. @@ -103,7 +103,7 @@ deallocates space (i.e., creates a hole) in the byte range starting at .I offset and continuing for -.I len +.I size bytes. Within the specified range, partial filesystem blocks are zeroed, and whole filesystem blocks are removed from the file. @@ -150,15 +150,15 @@ removes a byte range from a file, without leaving a hole. The byte range to be collapsed starts at .I offset and continues for -.I len +.I size bytes. At the completion of the operation, the contents of the file starting at the location -.I offset+len +.I offset+size will be appended at the location .IR offset , and the file will be -.I len +.I size bytes smaller. .P A filesystem may place limitations on the granularity of the operation, @@ -166,7 +166,7 @@ in order to ensure efficient implementation. Typically, .I offset and -.I len +.I size must be a multiple of the filesystem logical block size, which varies according to the filesystem type and configuration. If a filesystem has such a requirement, @@ -178,7 +178,7 @@ if this requirement is violated. If the region specified by .I offset plus -.I len +.I size reaches or passes the end of file, an error is returned; instead, use .BR ftruncate (2) @@ -206,7 +206,7 @@ in zeros space in the byte range starting at .I offset and continuing for -.I len +.I size bytes. Within the specified range, blocks are preallocated for the regions that span the holes in the file. @@ -225,7 +225,7 @@ flag is additionally specified in .IR mode , the behavior of the call is similar, but the file size will not be changed even if -.IR offset + len +.IR offset + size is greater than the file size. This behavior is the same as when preallocating space with .B FALLOC_FL_KEEP_SIZE @@ -260,15 +260,15 @@ overwriting any existing data. The hole will start at .I offset and continue for -.I len +.I size bytes. When inserting the hole inside file, the contents of the file starting at .I offset will be shifted upward (i.e., to a higher file offset) by -.I len +.I size bytes. Inserting a hole inside a file increases the file size by -.I len +.I size bytes. .P This mode has the same limitations as @@ -313,7 +313,7 @@ is set to indicate the error. is not a valid file descriptor, or is not opened for writing. .TP .B EFBIG -.IR offset + len +.IR offset + size exceeds the maximum file size. .TP .B EFBIG @@ -329,10 +329,10 @@ A signal was caught during execution; see .B EINVAL .I offset was less than 0, or -.I len -.\" FIXME . (raise a kernel bug) Probably the len==0 case should be +.I size +.\" FIXME . (raise a kernel bug) Probably the size==0 case should be .\" a no-op, rather than an error. That would be consistent with -.\" similar APIs for the len==0 case. +.\" similar APIs for the size==0 case. .\" See "Re: [PATCH] fallocate.2: add FALLOC_FL_PUNCH_HOLE flag definition" .\" 21 Sep 2012 .\" http://thread.gmane.org/gmane.linux.file-systems/48331/focus=1193526 @@ -345,7 +345,7 @@ is and the range specified by .I offset plus -.I len +.I size reaches or passes the end of the file. .TP .B EINVAL @@ -365,7 +365,7 @@ or but either .I offset or -.I len +.I size is not a multiple of the filesystem block size. .TP .B EINVAL diff --git a/man/man2/get_robust_list.2 b/man/man2/get_robust_list.2 index 67106bacb9..82e7b37d2b 100644 --- a/man/man2/get_robust_list.2 +++ b/man/man2/get_robust_list.2 @@ -21,9 +21,9 @@ Standard C library .B #include <unistd.h> .P .BI "long syscall(SYS_get_robust_list, int " pid , -.BI " struct robust_list_head **" head_ptr ", size_t *" len_ptr ); +.BI " struct robust_list_head **" head_ptr ", size_t *" sizep ); .B long syscall(SYS_set_robust_list, -.BI " struct robust_list_head *" head ", size_t " len ); +.BI " struct robust_list_head *" head ", size_t " size ); .fi .P .IR Note : @@ -65,7 +65,7 @@ The list head is stored in the location pointed to by The size of the object pointed to by .I **head_ptr is stored in -.IR len_ptr . +.IR sizep . .P Permission to employ .BR get_robust_list () @@ -82,7 +82,7 @@ The .I head argument is the list head to record. The -.I len +.I size argument should be .IR sizeof(*head) . .SH RETURN VALUE @@ -98,7 +98,7 @@ The system call can fail with the following error: .TP .B EINVAL -.I len +.I size does not equal .IR "sizeof(struct\ robust_list_head)" . .P diff --git a/man/man2/getdomainname.2 b/man/man2/getdomainname.2 index 9315f31799..f93e64f7cf 100644 --- a/man/man2/getdomainname.2 +++ b/man/man2/getdomainname.2 @@ -16,8 +16,8 @@ Standard C library .nf .B #include <unistd.h> .P -.BI "int getdomainname(char *" name ", size_t " len ); -.BI "int setdomainname(const char *" name ", size_t " len ); +.BI "int getdomainname(char *" name ", size_t " size ); +.BI "int setdomainname(const char *" name ", size_t " size ); .fi .P .RS -4 @@ -46,7 +46,7 @@ process's UTS namespace. sets the domain name to the value given in the character array .IR name . The -.I len +.I size argument specifies the number of bytes in .IR name . (Thus, @@ -56,8 +56,8 @@ does not require a terminating null byte.) .BR getdomainname () returns the null-terminated domain name in the character array .IR name , -which has a length of -.I len +which has a size of +.I size bytes. If the null-terminated domain name requires more than \fIlen\fP bytes, .BR getdomainname () @@ -76,7 +76,7 @@ can fail with the following errors: pointed outside of user address space. .TP .B EINVAL -.I len +.I size was negative or too large. .TP .B EPERM @@ -95,8 +95,8 @@ under libc: .I name is NULL or .I name -is longer than -.I len +is equal or longer than +.I size bytes. .SH VERSIONS On most Linux architectures (including x86), @@ -112,7 +112,7 @@ field returned from a call to None. .\" But they appear on most systems... .SH HISTORY -Since Linux 1.0, the limit on the length of a domain name, +Since Linux 1.0, the limit on the size of a domain name, including the terminating null byte, is 64 bytes. In older kernels, it was 8 bytes. .SH SEE ALSO diff --git a/man/man2/gethostname.2 b/man/man2/gethostname.2 index 68097a195e..2f51044c11 100644 --- a/man/man2/gethostname.2 +++ b/man/man2/gethostname.2 @@ -19,8 +19,8 @@ Standard C library .nf .B #include <unistd.h> .P -.BI "int gethostname(char *" name ", size_t " len ); -.BI "int sethostname(const char *" name ", size_t " len ); +.BI "int gethostname(char *" name ", size_t " size ); +.BI "int sethostname(const char *" name ", size_t " size ); .fi .P .RS -4 @@ -55,7 +55,7 @@ process's UTS namespace. sets the hostname to the value given in the character array .IR name . The -.I len +.I size argument specifies the number of bytes in .IR name . (Thus, @@ -65,8 +65,8 @@ does not require a terminating null byte.) .BR gethostname () returns the null-terminated hostname in the character array .IR name , -which has a length of -.I len +which has a size of +.I size bytes. If the null-terminated hostname is too large to fit, then the name is truncated, and no error is returned (but see VERSIONS below). @@ -85,18 +85,18 @@ is set to indicate the error. is an invalid address. .TP .B EINVAL -.I len +.I size is negative -.\" Can't occur for gethostbyname() wrapper, since 'len' has an +.\" Can't occur for gethostbyname() wrapper, since 'size' has an .\" unsigned type; can occur for the underlying system call. or, for .BR sethostname (), -.I len +.I size is larger than the maximum allowed size. .TP .B ENAMETOOLONG .RB "(glibc " gethostname ()) -.I len +.I size is smaller than the actual size. (Before glibc 2.1, glibc uses .B EINVAL @@ -127,7 +127,7 @@ system call; instead, it implements as a library function that calls .BR uname (2) and copies up to -.I len +.I size bytes from the returned .I nodename field into @@ -135,7 +135,7 @@ field into Having performed the copy, the function then checks if the length of the .I nodename was greater than or equal to -.IR len , +.IR size , and if it is, then the function returns \-1 with .I errno set to @@ -161,7 +161,7 @@ Versions of glibc before glibc 2.2 handle the case where the length of the .I nodename was greater than or equal to -.I len +.I size differently: nothing is copied into .I name and the function returns \-1 with diff --git a/man/man2/init_module.2 b/man/man2/init_module.2 index 55eba9ab55..b00b5a50c5 100644 --- a/man/man2/init_module.2 +++ b/man/man2/init_module.2 @@ -16,8 +16,8 @@ Standard C library .BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */" .B #include <unistd.h> .P -.BI "int syscall(SYS_init_module, void " module_image [. len "], \ -unsigned long " len , +.BI "int syscall(SYS_init_module, void " module_image [. size "], \ +unsigned long " size , .BI " const char *" param_values ); .BI "int syscall(SYS_finit_module, int " fd , .BI " const char *" param_values ", int " flags ); @@ -41,7 +41,7 @@ The .I module_image argument points to a buffer containing the binary image to be loaded; -.I len +.I size specifies the size of that buffer. The module image should be a valid ELF image, built for the running kernel. .P diff --git a/man/man2/lookup_dcookie.2 b/man/man2/lookup_dcookie.2 index 2be5b920a1..ca57fa7cdf 100644 --- a/man/man2/lookup_dcookie.2 +++ b/man/man2/lookup_dcookie.2 @@ -15,8 +15,8 @@ Standard C library .BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */" .B #include <unistd.h> .P -.BI "int syscall(SYS_lookup_dcookie, uint64_t " cookie ", char *" buffer , -.BI " size_t " len ); +.BI "int syscall(SYS_lookup_dcookie, uint64_t " cookie ", char " buffer [. size ], +.BI " size_t " size ); .fi .P .IR Note : diff --git a/man/man2/madvise.2 b/man/man2/madvise.2 index 85674bcc32..4f2210ee2e 100644 --- a/man/man2/madvise.2 +++ b/man/man2/madvise.2 @@ -22,7 +22,7 @@ Standard C library .nf .B #include <sys/mman.h> .P -.BI "int madvise(void " addr [. length "], size_t " length ", int " advice ); +.BI "int madvise(void " addr [. size "], size_t " size ", int " advice ); .fi .P .RS -4 @@ -44,13 +44,13 @@ system call is used to give advice or directions to the kernel about the address range beginning at address .I addr and with size -.IR length . +.IR size . .BR madvise () only operates on whole pages, therefore .I addr must be page-aligned. The value of -.I length +.I size is rounded up to a multiple of page size. In most cases, the goal of such advice is to improve system or application performance. @@ -146,7 +146,7 @@ map the pages into user space.) Support for Huge TLB pages was added in Linux v5.18. Addresses within a mapping backed by Huge TLB pages must be aligned to the underlying Huge TLB page size, -and the range length is rounded up +and the range size is rounded up to a multiple of the underlying Huge TLB page size. .\" .\" ====================================================================== @@ -241,7 +241,7 @@ restoring the default behavior, whereby a mapping is inherited across Poison the pages in the range specified by .I addr and -.I length +.I size and handle subsequent references to those pages like a hardware memory corruption. This operation is available only for privileged @@ -260,7 +260,7 @@ it is available only if the kernel was configured with Enable Kernel Samepage Merging (KSM) for the pages in the range specified by .I addr and -.IR length . +.IR size . The kernel regularly scans those areas of user memory that have been marked as mergeable, looking for pages with identical content. @@ -290,14 +290,14 @@ operation on the specified address range; KSM unmerges whatever pages it had merged in the address range specified by .I addr and -.IR length . +.IR size . .TP .BR MADV_SOFT_OFFLINE " (since Linux 2.6.33)" .\" commit afcf938ee0aac4ef95b1a23bac704c6fbeb26de6 Soft offline the pages in the range specified by .I addr and -.IR length . +.IR size . The memory of each page in the specified range is preserved (i.e., when next accessed, the same content will be visible, but in a new physical page frame), @@ -319,7 +319,7 @@ it is available only if the kernel was configured with Enable Transparent Huge Pages (THP) for pages in the range specified by .I addr and -.IR length . +.IR size . The kernel will regularly scan the areas marked as huge page candidates to replace them with huge pages. The kernel will also allocate huge pages directly when the region is @@ -399,7 +399,7 @@ and file/shmem memory is only supported if the kernel was configured with Ensures that memory in the address range specified by .I addr and -.I length +.I size will not be backed by transparent hugepages. .TP .BR MADV_COLLAPSE " (since Linux 6.1)" @@ -484,7 +484,7 @@ only the most-recently\[en]failed code will be set in Exclude from a core dump those pages in the range specified by .I addr and -.IR length . +.IR size . This is useful in applications that have large areas of memory that are known not to be useful in a core dump. The effect of @@ -502,7 +502,7 @@ Undo the effect of an earlier The application no longer requires the pages in the range specified by .I addr and -.IR len . +.IR size . The kernel can thus free these pages, but the freeing could be delayed until memory pressure occurs. For each of the pages that has been marked to be freed @@ -721,9 +721,9 @@ flag described elsewhere in this page). .B EINVAL .I addr is not page-aligned or -.I length +.I size is negative. -.\" .I length +.\" .I size .\" is zero, .TP .B EINVAL @@ -860,7 +860,7 @@ and so on, with behavior close to the similarly named flags listed above. The Linux implementation requires that the address .I addr be page-aligned, and allows -.I length +.I size to be zero. If there are some parts of the specified address range that are not mapped, the Linux version of diff --git a/man/man2/mbind.2 b/man/man2/mbind.2 index 66caeb379f..fd1aca4ad7 100644 --- a/man/man2/mbind.2 +++ b/man/man2/mbind.2 @@ -25,7 +25,7 @@ NUMA (Non-Uniform Memory Access) policy library .nf .B "#include <numaif.h>" .P -.BI "long mbind(void " addr [. len "], unsigned long " len ", int " mode , +.BI "long mbind(void " addr [. size "], unsigned long " size ", int " mode , .BI " const unsigned long " nodemask [(. maxnode " + ULONG_WIDTH - 1)" .B " / ULONG_WIDTH]," .BI " unsigned long " maxnode ", unsigned int " flags ); @@ -37,12 +37,12 @@ which consists of a policy mode and zero or more nodes, for the memory range starting with .I addr and continuing for -.I len +.I size bytes. The memory policy defines from which node memory is allocated. .P If the memory range specified by the -.IR addr " and " len +.IR addr " and " size arguments includes an "anonymous" region of memory\[em]that is a region of memory created using the .BR mmap (2) @@ -375,7 +375,7 @@ points outside your accessible address space. Or, there was an unmapped hole in the specified memory range specified by .I addr and -.IR len . +.IR size . .TP .B EINVAL An invalid value was specified for @@ -383,7 +383,7 @@ An invalid value was specified for or .IR mode ; or -.I addr + len +.I addr + size was less than .IR addr ; or diff --git a/man/man2/memfd_create.2 b/man/man2/memfd_create.2 index 33e3a04318..946890e660 100644 --- a/man/man2/memfd_create.2 +++ b/man/man2/memfd_create.2 @@ -425,7 +425,7 @@ main(int argc, char *argv[]) { int fd; char *name, *seals_arg; - ssize_t len; + ssize_t size; unsigned int seals; \& if (argc < 3) { @@ -441,7 +441,7 @@ main(int argc, char *argv[]) } \& name = argv[1]; - len = atoi(argv[2]); + size = atoi(argv[2]); seals_arg = argv[3]; \& /* Create an anonymous file in tmpfs; allow seals to be @@ -453,7 +453,7 @@ main(int argc, char *argv[]) \& /* Size the file as specified on the command line. */ \& - if (ftruncate(fd, len) == \-1) + if (ftruncate(fd, size) == \-1) err(EXIT_FAILURE, "truncate"); \& printf("PID: %jd; fd: %d; /proc/%jd/fd/%d\[rs]n", diff --git a/man/man2/mlock.2 b/man/man2/mlock.2 index bd14856119..6431a079c0 100644 --- a/man/man2/mlock.2 +++ b/man/man2/mlock.2 @@ -14,10 +14,10 @@ Standard C library .nf .B #include <sys/mman.h> .P -.BI "int mlock(const void " addr [. len "], size_t " len ); -.BI "int mlock2(const void " addr [. len "], size_t " len ", \ +.BI "int mlock(const void " addr [. size "], size_t " size ); +.BI "int mlock2(const void " addr [. size "], size_t " size ", \ unsigned int " flags ); -.BI "int munlock(const void " addr [. len "], size_t " len ); +.BI "int munlock(const void " addr [. size "], size_t " size ); .P .BI "int mlockall(int " flags ); .B int munlockall(void); @@ -45,7 +45,7 @@ Memory locking and unlocking are performed in units of whole pages. locks pages in the address range starting at .I addr and continuing for -.I len +.I size bytes. All pages that contain a part of the specified address range are guaranteed to be resident in RAM when the call returns successfully; @@ -58,7 +58,7 @@ the pages are guaranteed to stay in RAM until later unlocked. also locks pages in the specified range starting at .I addr and continuing for -.I len +.I size bytes. However, the state of the pages contained in that range after the call returns successfully will depend on the value in the @@ -85,7 +85,7 @@ behaves exactly the same as unlocks pages in the address range starting at .I addr and continuing for -.I len +.I size bytes. After this call, all pages that contain a part of the specified memory range can be moved to external swap space again by the kernel. @@ -182,7 +182,7 @@ Some or all of the specified address range could not be locked. and .BR munlock ()) The result of the addition -.IR addr + len +.IR addr + size was less than .I addr (e.g., the addition may have resulted in an overflow). @@ -457,7 +457,7 @@ a bug in the kernel's accounting of locked memory for unprivileged processes meant that if the region specified by .I addr and -.I len +.I size overlapped an existing lock, then the already locked bytes in the overlapping region were counted twice when checking against the limit. diff --git a/man/man2/mprotect.2 b/man/man2/mprotect.2 index fdc61d9590..5a216be87d 100644 --- a/man/man2/mprotect.2 +++ b/man/man2/mprotect.2 @@ -20,18 +20,18 @@ Standard C library .nf .B #include <sys/mman.h> .P -.BI "int mprotect(void " addr [. len "], size_t " len ", int " prot ); +.BI "int mprotect(void " addr [. size "], size_t " size ", int " prot ); .P .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" .B #include <sys/mman.h> .P -.BI "int pkey_mprotect(void " addr [. len "], size_t " len ", int " prot ", int " pkey ");" +.BI "int pkey_mprotect(void " addr [. size "], size_t " size ", int " prot ", int " pkey ");" .fi .SH DESCRIPTION .BR mprotect () changes the access protections for the calling process's memory pages containing any part of the address range in the -interval [\fIaddr\fP,\ \fIaddr\fP+\fIlen\fP\-1]. +interval [\fIaddr\fP,\ \fIaddr\fP+\fIsize\fP\-1]. .I addr must be aligned to a page boundary. .P @@ -107,7 +107,7 @@ Like changes the protection on the pages specified by .I addr and -.IR len . +.IR size . The .I pkey argument specifies the protection key (see @@ -173,7 +173,7 @@ Internal kernel structures could not be allocated. .B ENOMEM Addresses in the range .RI [ addr , -.IR addr + len \-1] +.IR addr + size \-1] are invalid for the address space of the process, or specify one or more pages that are not mapped. (Before Linux 2.4.19, the error diff --git a/man/man2/pciconfig_read.2 b/man/man2/pciconfig_read.2 index 3161cfdacb..779be7bb49 100644 --- a/man/man2/pciconfig_read.2 +++ b/man/man2/pciconfig_read.2 @@ -17,10 +17,10 @@ Standard C library .B #include <pci.h> .P .BI "int pciconfig_read(unsigned long " bus ", unsigned long " dfn , -.BI " unsigned long " off ", unsigned long " len , +.BI " unsigned long " off ", unsigned long " size , .BI " unsigned char *" buf ); .BI "int pciconfig_write(unsigned long " bus ", unsigned long " dfn , -.BI " unsigned long " off ", unsigned long " len , +.BI " unsigned long " off ", unsigned long " size , .BI " unsigned char *" buf ); .BI "int pciconfig_iobase(int " which ", unsigned long " bus , .BI " unsigned long " devfn ); @@ -82,7 +82,7 @@ are: .SH ERRORS .TP .B EINVAL -.I len +.I size value is invalid. This does not apply to .BR pciconfig_iobase (). diff --git a/man/man2/perf_event_open.2 b/man/man2/perf_event_open.2 index 2abe1c27a6..bcc6a39cb9 100644 --- a/man/man2/perf_event_open.2 +++ b/man/man2/perf_event_open.2 @@ -275,7 +275,7 @@ struct perf_event_attr { }; \& union { - __u64 bp_len; /* breakpoint length */ + __u64 bp_len; /* breakpoint size */ __u64 kprobe_addr; /* with kprobe_func == NULL */ __u64 probe_offset; /* for perf_[k,u]probe */ __u64 config2; /* extension of config1 */ @@ -1450,7 +1450,7 @@ on Linux 3.3 and later kernels. .IR bp_len " (since Linux 2.6.33)" .\" commit 24f1e32c60c45c89a997c73395b69c8af6f0a84e .I bp_len -is the length of the breakpoint being measured if +is the size of the breakpoint being measured if .I type is .BR PERF_TYPE_BREAKPOINT . @@ -2223,7 +2223,7 @@ is the thread ID. .I addr is the address of the allocated memory. .I len -is the length of the allocated memory. +is the size of the allocated memory. .I pgoff is the page offset of the allocated memory. .I filename @@ -2491,7 +2491,8 @@ This is the current callchain. If .B PERF_SAMPLE_RAW is enabled, then a 32-bit value indicating size -is included followed by an array of 8-bit values of length size. +is included followed by an array of 8-bit values of size +.IR size . The values are padded with 0 to have 64-bit alignment. .IP This RAW record data is opaque with respect to the ABI. @@ -2923,7 +2924,7 @@ is the thread ID. is the address of the allocated memory. .TP .I len -is the length of the allocated memory. +is the size of the allocated memory. .TP .I pgoff is the page offset of the allocated memory. @@ -3176,7 +3177,7 @@ struct { is the address of the kernel symbol. .TP .I len -is the length of the kernel symbol. +is the size of the kernel symbol. .TP .I ksym_type is the type of the kernel symbol. @@ -3262,7 +3263,7 @@ is the path of the cgroup from the root. .\" commit e17d43b93e544f5016c0251d2074c15568d5d963 This record indicates a change in the kernel text. This includes addition and removal of the text -and the corresponding length is zero in this case. +and the corresponding size is zero in this case. .IP .in +4n .EX @@ -3282,10 +3283,10 @@ struct { is the address of the change .TP .I old_len -is the old length +is the old size .TP .I new_len -is the new length +is the new size .TP .I bytes contains old bytes immediately followed by new bytes. diff --git a/man/man2/posix_fadvise.2 b/man/man2/posix_fadvise.2 index ed40b0c0d3..0be779ab4a 100644 --- a/man/man2/posix_fadvise.2 +++ b/man/man2/posix_fadvise.2 @@ -16,7 +16,7 @@ Standard C library .nf .B #include <fcntl.h> .P -.BI "int posix_fadvise(int " fd ", off_t " offset ", off_t " len \ +.BI "int posix_fadvise(int " fd ", off_t " offset ", off_t " size \ ", int " advice ");" .fi .P @@ -92,7 +92,7 @@ It is preferable to preserve needed data than discard unneeded data. If the application requires that data be considered for discarding, then .I offset and -.I len +.I size must be page-aligned. .IP The implementation @@ -165,7 +165,7 @@ For example, since Linux 2.6.14, ARM has the following system call: .in +4n .EX .BI "long arm_fadvise64_64(int " fd ", int " advice , -.BI " loff_t " offset ", loff_t " len ); +.BI " loff_t " offset ", loff_t " size ); .EE .in .P @@ -195,7 +195,7 @@ depending on the setting of the configuration option. .P The type of the -.I len +.I size argument was changed from .I size_t to @@ -215,7 +215,7 @@ and then applying to the mapping. .SH BUGS Before Linux 2.6.6, if -.I len +.I size was specified as 0, then this was interpreted literally as "zero bytes", rather than as meaning "all bytes through to the end of the file". .SH SEE ALSO diff --git a/man/man2/ptrace.2 b/man/man2/ptrace.2 index a7d187436a..9edad46341 100644 --- a/man/man2/ptrace.2 +++ b/man/man2/ptrace.2 @@ -305,7 +305,7 @@ constant. .I data points to a .BR "struct iovec" , -which describes the destination buffer's location and length. +which describes the destination buffer's location and size. On return, the kernel modifies .B iov.len to indicate the actual number of bytes returned. diff --git a/man/man2/recv.2 b/man/man2/recv.2 index b578a8a35e..727e89864d 100644 --- a/man/man2/recv.2 +++ b/man/man2/recv.2 @@ -20,9 +20,9 @@ Standard C library .nf .B #include <sys/socket.h> .P -.BI "ssize_t recv(int " sockfd ", void " buf [. len "], size_t " len , +.BI "ssize_t recv(int " sockfd ", void " buf [. size "], size_t " size , .BI " int " flags ); -.BI "ssize_t recvfrom(int " sockfd ", void " buf "[restrict ." len "], size_t " len , +.BI "ssize_t recvfrom(int " sockfd ", void " buf "[restrict ." size "], size_t " size , .BI " int " flags , .BI " struct sockaddr *_Nullable restrict " src_addr , .BI " socklen_t *_Nullable restrict " addrlen ); @@ -57,7 +57,7 @@ Also, the following call .P .in +4n .EX -recv(sockfd, buf, len, flags); +recv(sockfd, buf, size, flags); .EE .in .P @@ -65,11 +65,11 @@ is equivalent to .P .in +4n .EX -recvfrom(sockfd, buf, len, flags, NULL, NULL); +recvfrom(sockfd, buf, size, flags, NULL, NULL); .EE .in .P -All three calls return the length of the message on successful +All three calls return the size of the message on successful completion. If a message is too long to fit in the supplied buffer, excess bytes may be discarded depending on the type of socket the message is @@ -230,7 +230,7 @@ netlink (since Linux 2.6.22), and UNIX datagram as well as sequenced-packet .\" commit 9f6f9af7694ede6314bed281eec74d588ba9474f (since Linux 3.4) sockets: -return the real length of the packet or datagram, +return the real size of the packet or datagram, even when it was longer than the passed buffer. .IP For use with Internet stream sockets, see @@ -249,7 +249,7 @@ This flag has no effect for datagram sockets. places the received message into the buffer .IR buf . The caller must specify the size of the buffer in -.IR len . +.IR size . .P If .I src_addr @@ -296,7 +296,7 @@ It is equivalent to the call: .P .in +4n .EX -recvfrom(fd, buf, len, flags, NULL, 0); +recvfrom(fd, buf, size, flags, NULL, 0); .EE .in .\" @@ -317,7 +317,7 @@ struct msghdr { struct iovec *msg_iov; /* Scatter/gather array */ size_t msg_iovlen; /* # elements in msg_iov */ void *msg_control; /* Ancillary data, see below */ - size_t msg_controllen; /* Ancillary data buffer len */ + size_t msg_controllen; /* Ancillary data buffer size */ int msg_flags; /* Flags on received message */ }; .EE @@ -332,7 +332,7 @@ The caller should set to the size of this buffer before this call; upon return from a successful call, .I msg_namelen -will contain the length of the returned address. +will contain the size of the returned address. If the application does not need to know the source address, .I msg_name can be specified as NULL. @@ -346,7 +346,7 @@ describe scatter-gather locations, as discussed in .P The field .IR msg_control , -which has length +which has size .IR msg_controllen , points to a buffer for other protocol control-related messages or miscellaneous ancillary data. @@ -354,9 +354,9 @@ When .BR recvmsg () is called, .I msg_controllen -should contain the length of the available buffer in +should contain the size of the available buffer in .IR msg_control ; -upon return from a successful call it will contain the length +upon return from a successful call it will contain the size of the control message sequence. .P The messages are of the form: @@ -432,7 +432,7 @@ When a stream socket peer has performed an orderly shutdown, the return value will be 0 (the traditional "end-of-file" return). .P Datagram sockets in various domains (e.g., the UNIX and Internet domains) -permit zero-length datagrams. +permit zero-size datagrams. When such a datagram is received, the return value is 0. .P The value 0 may also be returned if the requested number of bytes @@ -523,7 +523,7 @@ and .B MSG_WAITALL flags. .SH NOTES -If a zero-length datagram is pending, +If a zero-size datagram is pending, .BR read (2) and .BR recv () diff --git a/man/man2/recvmmsg.2 b/man/man2/recvmmsg.2 index d729ba6878..685edf0851 100644 --- a/man/man2/recvmmsg.2 +++ b/man/man2/recvmmsg.2 @@ -19,8 +19,8 @@ Standard C library .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" .B #include <sys/socket.h> .P -.BI "int recvmmsg(int " sockfd ", struct mmsghdr *" msgvec \ -", unsigned int " vlen "," +.BI "int recvmmsg(int " sockfd \ +", struct mmsghdr " msgvec [. n "], unsigned int " n , .BI " int " flags ", struct timespec *" timeout ");" .fi .SH DESCRIPTION @@ -45,7 +45,7 @@ argument is a pointer to an array of .I mmsghdr structures. The size of this array is specified in -.IR vlen . +.IR n . .P The .I mmsghdr @@ -105,12 +105,12 @@ is NULL, then the operation blocks indefinitely. A blocking .BR recvmmsg () call blocks until -.I vlen +.I n messages have been received or until the timeout expires. A nonblocking call reads as many messages as are available (up to the limit specified by -.IR vlen ) +.IR n ) and returns immediately. .P On return from @@ -158,7 +158,7 @@ argument does not work as intended. .\" http://thread.gmane.org/gmane.linux.man/5677 The timeout is checked only after the receipt of each datagram, so that if up to -.I vlen\-1 +.I n\-1 datagrams are received before the timeout expires, but then no further datagrams are received, the call will block forever. .P diff --git a/man/man2/seccomp_unotify.2 b/man/man2/seccomp_unotify.2 index 0f6abb7336..0c7ee49112 100644 --- a/man/man2/seccomp_unotify.2 +++ b/man/man2/seccomp_unotify.2 @@ -1708,14 +1708,14 @@ cookieIsValid(int notifyFd, uint64_t id) /* Access the memory of the target process in order to fetch the pathname referred to by the system call argument \[aq]argNum\[aq] in \[aq]req\->data.args[]\[aq]. The pathname is returned in \[aq]path\[aq], - a buffer of \[aq]len\[aq] bytes allocated by the caller. + a buffer of \[aq]size\[aq] bytes allocated by the caller. \& Returns true if the pathname is successfully fetched, and false otherwise. For possible causes of failure, see the comments below. */ \& static bool getTargetPathname(struct seccomp_notif *req, int notifyFd, - int argNum, char *path, size_t len) + int argNum, char *path, size_t size) { int procMemFd; char procMemPath[PATH_MAX]; @@ -1742,7 +1742,7 @@ getTargetPathname(struct seccomp_notif *req, int notifyFd, \& /* Read bytes at the location containing the pathname argument */ \& - nread = pread(procMemFd, path, len, req\->data.args[argNum]); + nread = pread(procMemFd, path, size, req\->data.args[argNum]); \& close(procMemFd); \& diff --git a/man/man2/send.2 b/man/man2/send.2 index b14ef12374..82aae39230 100644 --- a/man/man2/send.2 +++ b/man/man2/send.2 @@ -19,9 +19,9 @@ Standard C library .nf .B #include <sys/socket.h> .P -.BI "ssize_t send(int " sockfd ", const void " buf [. len "], size_t " len \ +.BI "ssize_t send(int " sockfd ", const void " buf [. size "], size_t " size \ ", int " flags ); -.BI "ssize_t sendto(int " sockfd ", const void " buf [. len "], size_t " len \ +.BI "ssize_t sendto(int " sockfd ", const void " buf [. size "], size_t " size \ ", int " flags , .BI " const struct sockaddr *" dest_addr ", socklen_t " addrlen ); .BI "ssize_t sendmsg(int " sockfd ", const struct msghdr *" msg \ @@ -56,7 +56,7 @@ Also, the following call .P .in +4n .EX -send(sockfd, buf, len, flags); +send(sockfd, buf, size, flags); .EE .in .P @@ -64,7 +64,7 @@ is equivalent to .P .in +4n .EX -sendto(sockfd, buf, len, flags, NULL, 0); +sendto(sockfd, buf, size, flags, NULL, 0); .EE .in .P @@ -106,8 +106,8 @@ and .BR sendto (), the message is found in .I buf -and has length -.IR len . +and has size +.IR size . For .BR sendmsg (), the message is pointed to by the elements of the array @@ -282,7 +282,7 @@ struct msghdr { struct iovec *msg_iov; /* Scatter/gather array */ size_t msg_iovlen; /* # elements in msg_iov */ void *msg_control; /* Ancillary data, see below */ - size_t msg_controllen; /* Ancillary data buffer len */ + size_t msg_controllen; /* Ancillary data buffer size */ int msg_flags; /* Flags (unused) */ }; .EE @@ -310,7 +310,7 @@ You may send control information (ancillary data) using the and .I msg_controllen members. -The maximum control buffer length the kernel can process is limited +The maximum control buffer size the kernel can process is limited per socket by the value in .IR /proc/sys/net/core/optmem_max ; see diff --git a/man/man2/sendmmsg.2 b/man/man2/sendmmsg.2 index f740b98843..d5122827d5 100644 --- a/man/man2/sendmmsg.2 +++ b/man/man2/sendmmsg.2 @@ -16,8 +16,8 @@ Standard C library .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" .B #include <sys/socket.h> .P -.BI "int sendmmsg(int " sockfd ", struct mmsghdr *" msgvec \ -", unsigned int " vlen "," +.BI "int sendmmsg(int " sockfd \ +", struct mmsghdr " msgvec [. n "], unsigned int " n , .BI " int " flags ");" .fi .SH DESCRIPTION @@ -41,7 +41,7 @@ argument is a pointer to an array of .I mmsghdr structures. The size of this array is specified in -.IR vlen . +.IR n . .P The .I mmsghdr @@ -81,11 +81,11 @@ The flags are the same as for A blocking .BR sendmmsg () call blocks until -.I vlen +.I n messages have been sent. A nonblocking call sends as many messages as possible (up to the limit specified by -.IR vlen ) +.IR n ) and returns immediately. .P On return from @@ -105,7 +105,7 @@ On success, returns the number of messages sent from .IR msgvec ; if this is less than -.IR vlen , +.IR n , the caller can retry with a further .BR sendmmsg () call to send the remaining messages. @@ -133,7 +133,7 @@ Linux 3.0, glibc 2.14. .SH NOTES The value specified in -.I vlen +.I n is capped to .B UIO_MAXIOV (1024). diff --git a/man/man2/shmop.2 b/man/man2/shmop.2 index f8e957f676..4a1afcfff8 100644 --- a/man/man2/shmop.2 +++ b/man/man2/shmop.2 @@ -456,7 +456,7 @@ main(int argc, char *argv[]) { int semid, shmid; char *addr; - size_t len; + size_t size; struct sembuf sop; \& if (argc != 4) { @@ -464,8 +464,8 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } \& - len = strlen(argv[3]) + 1; /* +1 to include trailing \[aq]\[rs]0\[aq] */ - if (len > MEM_SIZE) { + size = strlen(argv[3]) + 1; /* +1 to include trailing \[aq]\[rs]0\[aq] */ + if (size > MEM_SIZE) { fprintf(stderr, "String is too big!\[rs]n"); exit(EXIT_FAILURE); } @@ -482,7 +482,7 @@ main(int argc, char *argv[]) if (addr == (void *) \-1) errExit("shmat"); \& - memcpy(addr, argv[3], len); + memcpy(addr, argv[3], size); \& /* Decrement semaphore to 0. */ \& diff --git a/man/man2/splice.2 b/man/man2/splice.2 index 4824a7051d..e9a54719b5 100644 --- a/man/man2/splice.2 +++ b/man/man2/splice.2 @@ -17,7 +17,7 @@ Standard C library .P .BI "ssize_t splice(int " fd_in ", off_t *_Nullable " off_in , .BI " int " fd_out ", off_t *_Nullable " off_out , -.BI " size_t " len ", unsigned int " flags ); +.BI " size_t " size ", unsigned int " flags ); .\" Return type was long before glibc 2.7 .fi .SH DESCRIPTION @@ -25,7 +25,7 @@ Standard C library moves data between two file descriptors without copying between kernel address space and user address space. It transfers up to -.I len +.I size bytes of data from the file descriptor .I fd_in to the file descriptor diff --git a/man/man2/subpage_prot.2 b/man/man2/subpage_prot.2 index e092708f3f..a65a465f33 100644 --- a/man/man2/subpage_prot.2 +++ b/man/man2/subpage_prot.2 @@ -18,7 +18,7 @@ Standard C library .BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */" .B #include <unistd.h> .P -.BI "int syscall(SYS_subpage_prot, unsigned long " addr ", unsigned long " len , +.BI "int syscall(SYS_subpage_prot, unsigned long " addr ", unsigned long " size , .BI " uint32_t *" map ); .fi .P @@ -37,7 +37,7 @@ a page size of 64\ kB. The protection map is applied to the memory pages in the region starting at .I addr and continuing for -.I len +.I size bytes. Both of these arguments must be aligned to a 64-kB boundary. .P @@ -49,7 +49,7 @@ inside a 64\ kB page (so, the number of 32-bit words pointed to by .I map should equate to the number of 64-kB pages specified by -.IR len ). +.IR size ). Each 2-bit field in the protection map is either 0 to allow any access, 1 to prevent writes, or 2 or 3 to prevent all accesses. .SH RETURN VALUE @@ -68,7 +68,7 @@ is not accessible. The .I addr or -.I len +.I size arguments are incorrect. Both of these arguments must be aligned to a multiple of the system page size, and they must not refer to a region outside of the diff --git a/man/man2/sysctl.2 b/man/man2/sysctl.2 index 090c99fc0b..a7f9c888f6 100644 --- a/man/man2/sysctl.2 +++ b/man/man2/sysctl.2 @@ -32,7 +32,7 @@ The argument has the form .EX struct __sysctl_args { int *name; /* integer vector describing variable */ - int nlen; /* length of this vector */ + int nlen; /* number of elements of this vector */ void *oldval; /* 0 or address where to store old value */ size_t *oldlenp; /* available room for old value, overwritten by actual size of old value */ diff --git a/man/man2/syslog.2 b/man/man2/syslog.2 index 3c9b37a03d..5f5bd34ef1 100644 --- a/man/man2/syslog.2 +++ b/man/man2/syslog.2 @@ -23,12 +23,12 @@ Standard C library .BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */" .B #include <unistd.h> .P -.BI "int syscall(SYS_syslog, int " type ", char *" bufp ", int " len ); +.BI "int syscall(SYS_syslog, int " type ", char *" bufp ", int " size ); .P /* The glibc interface */ .B #include <sys/klog.h> .P -.BI "int klogctl(int " type ", char *" bufp ", int " len ); +.BI "int klogctl(int " type ", char *" bufp ", int " size ); .fi .SH DESCRIPTION .IR Note : @@ -47,7 +47,7 @@ system call, which is used to control the kernel buffer; the glibc wrapper function for the system call is called .BR klogctl (). .SS The kernel log buffer -The kernel has a cyclic buffer of length +The kernel has a cyclic buffer of size .B LOG_BUF_LEN in which messages given as arguments to the kernel function .BR printk () @@ -112,7 +112,7 @@ The call executes just the "clear ring buffer" command. The .I bufp and -.I len +.I size arguments are ignored. .IP This command does not really clear the ring buffer. @@ -147,7 +147,7 @@ below. The .I bufp and -.I len +.I size arguments are ignored. .TP .BR SYSLOG_ACTION_CONSOLE_ON " (7)" @@ -170,19 +170,19 @@ below. The .I bufp and -.I len +.I size arguments are ignored. .TP .BR SYSLOG_ACTION_CONSOLE_LEVEL " (8)" The call sets .I console_loglevel to the value given in -.IR len , +.IR size , which must be an integer between 1 and 8 (inclusive). The kernel silently enforces a minimum value of .I minimum_console_loglevel for -.IR len . +.IR size . See the .I log level section for details. @@ -198,7 +198,7 @@ from the kernel log buffer via command 2 The .I bufp and -.I len +.I size arguments are ignored. .TP .BR SYSLOG_ACTION_SIZE_BUFFER " (10) (since Linux 2.6.6)" @@ -206,7 +206,7 @@ This command returns the total size of the kernel log buffer. The .I bufp and -.I len +.I size arguments are ignored. .P All commands except 3 and 10 require privilege. @@ -334,7 +334,7 @@ or for .I buf is NULL, or -.I len +.I size is less than zero; or for .I type 8, the diff --git a/man/man2/tee.2 b/man/man2/tee.2 index 0b91b2b5b2..33b2b8b684 100644 --- a/man/man2/tee.2 +++ b/man/man2/tee.2 @@ -14,7 +14,7 @@ Standard C library .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" .B #include <fcntl.h> .P -.BI "ssize_t tee(int " fd_in ", int " fd_out ", size_t " len \ +.BI "ssize_t tee(int " fd_in ", int " fd_out ", size_t " size \ ", unsigned int " flags ); .fi .\" Return type was long before glibc 2.7 @@ -27,7 +27,7 @@ Standard C library .\" one pipe to two other pipes. .BR tee () duplicates up to -.I len +.I size bytes of data from the pipe referred to by the file descriptor .I fd_in to the pipe referred to by the file descriptor @@ -147,7 +147,7 @@ int main(int argc, char *argv[]) { int fd; - ssize_t len, slen; + ssize_t size, ssize; \& if (argc != 2) { fprintf(stderr, "Usage: %s <file>\[rs]n", argv[0]); @@ -164,28 +164,28 @@ main(int argc, char *argv[]) /* * tee stdin to stdout. */ - len = tee(STDIN_FILENO, STDOUT_FILENO, + size = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK); - if (len < 0) { + if (size < 0) { if (errno == EAGAIN) continue; perror("tee"); exit(EXIT_FAILURE); } - if (len == 0) + if (size == 0) break; \& /* * Consume stdin by splicing it to a file. */ - while (len > 0) { - slen = splice(STDIN_FILENO, NULL, fd, NULL, - len, SPLICE_F_MOVE); - if (slen < 0) { + while (size > 0) { + ssize = splice(STDIN_FILENO, NULL, fd, NULL, + size, SPLICE_F_MOVE); + if (ssize < 0) { perror("splice"); exit(EXIT_FAILURE); } - len \-= slen; + size \-= ssize; } } \& diff --git a/man/man2/userfaultfd.2 b/man/man2/userfaultfd.2 index 24a1901105..85936d3b21 100644 --- a/man/man2/userfaultfd.2 +++ b/man/man2/userfaultfd.2 @@ -417,7 +417,7 @@ struct uffd_msg { struct { /* Since Linux 4.11 */ __u64 from; /* Old address of remapped area */ __u64 to; /* New address of remapped area */ - __u64 len; /* Original mapping length */ + __u64 len; /* Original mapping size */ } remap; \& struct { /* Since Linux 4.11 */ @@ -558,7 +558,7 @@ The new address of the memory range that was remapped using .BR mremap (2). .TP .I remap.len -The original length of the memory range that was remapped using +The original size of the memory range that was remapped using .BR mremap (2). .TP .I remove.start @@ -861,7 +861,7 @@ main(int argc, char *argv[]) char c; char *addr; /* Start of region handled by userfaultfd */ long uffd; /* userfaultfd file descriptor */ - size_t len, l; /* Length of region handled by userfaultfd */ + size_t size, i; /* Size of region handled by userfaultfd */ pthread_t thr; /* ID of thread that handles page faults */ struct uffdio_api uffdio_api; struct uffdio_register uffdio_register; @@ -872,7 +872,7 @@ main(int argc, char *argv[]) } \& page_size = sysconf(_SC_PAGE_SIZE); - len = strtoull(argv[1], NULL, 0) * page_size; + size = strtoull(argv[1], NULL, 0) * page_size; \& /* Create and enable userfaultfd object. */ \& @@ -897,7 +897,7 @@ main(int argc, char *argv[]) actually touch the memory, it will be allocated via the userfaultfd. */ \& - addr = mmap(NULL, len, PROT_READ | PROT_WRITE, + addr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, \-1, 0); if (addr == MAP_FAILED) err(EXIT_FAILURE, "mmap"); @@ -909,7 +909,7 @@ main(int argc, char *argv[]) missing pages (i.e., pages that have not yet been faulted in). */ \& uffdio_register.range.start = (unsigned long) addr; - uffdio_register.range.len = len; + uffdio_register.range.len = size; uffdio_register.mode = UFFDIO_REGISTER_MODE_MISSING; if (ioctl(uffd, UFFDIO_REGISTER, &uffdio_register) == \-1) err(EXIT_FAILURE, "ioctl\-UFFDIO_REGISTER"); @@ -925,14 +925,14 @@ main(int argc, char *argv[]) locations 1024 bytes apart. This will trigger userfaultfd events for all pages in the region. */ \& - l = 0xf; /* Ensure that faulting address is not on a page + i = 0xf; /* Ensure that faulting address is not on a page boundary, in order to test that we correctly handle that case in fault_handling_thread(). */ - while (l < len) { - c = addr[l]; - printf("Read address %p in %s(): ", addr + l, __func__); + while (i < size) { + c = addr[i]; + printf("Read address %p in %s(): ", addr + i, __func__); printf("%c\[rs]n", c); - l += 1024; + i += 1024; usleep(100000); /* Slow things down a little */ } \& |
