diff --git a/man2/process_madvise.2 b/man2/process_madvise.2 index 3237147e1..d33c32f63 100644 --- a/man2/process_madvise.2 +++ b/man2/process_madvise.2 @@ -83,10 +83,50 @@ The specifies the number of elements in the .I iovec structure. +This value must be less than or equal to +.BR IOV_MAX +(defined in +.I +or accessible via the call +.IR sysconf(_SC_IOV_MAX) ). .PP The .I advice argument is one of the values listed below. +.PP +The +.I flags +argument is reserved for future use; currently, this argument must be +specified as 0. +.PP +The +.I vlen +and +.I iovec +arguments are checked before applying any hints. +If the +.I vlen +is too big, or +.I iovec +is invalid, +then an error will be returned immediately and no advice will be applied. +.PP +The hint might be applied to a part of +.I iovec +if one of its elements points to an invalid memory region in the +remote process. +No further elements will be processed beyond that point. +.PP +Permission to provide a hint to another process is governed by a +ptrace access mode +.B PTRACE_MODE_READ_REALCREDS +check (see +.BR ptrace (2)); +in addition, +because of the performance implications of applying the hint, +the caller must have the +.B CAP_SYS_ADMIN +capability. .\" .\" ====================================================================== .\" @@ -117,49 +157,6 @@ If a page is file-backed and dirty, it will be written back to the backing storage. The advice might be ignored for some pages in the range when it is not applicable. -.PP -The -.I flags -argument is reserved for future use; currently, this argument must be -specified as 0. -.PP -The value specified in the -.I vlen -argument must be less than or equal to -.BR IOV_MAX -(defined in -.I -or accessible via the call -.IR sysconf(_SC_IOV_MAX) ). -.PP -The -.I vlen -and -.I iovec -arguments are checked before applying any hints. -If the -.I vlen -is too big, or -.I iovec -is invalid, -then an error will be returned immediately and no advice will be applied. -.PP -The hint might be applied to a part of -.I iovec -if one of its elements points to an invalid memory region in the -remote process. -No further elements will be processed beyond that point. -.PP -Permission to provide a hint to another process is governed by a -ptrace access mode -.B PTRACE_MODE_READ_REALCREDS -check (see -.BR ptrace (2)); -in addition, -because of the performance implications of applying the hint, -the caller must have the -.B CAP_SYS_ADMIN -capability. .SH RETURN VALUE On success, .BR process_madvise ()