Go to main content

man pages section 3: Extended Library Functions, Volume 3

Exit Print View

Updated: Wednesday, July 27, 2022

pr_utimensat (3PROC)


pr_access, pr_chmod, pr_chown, pr_close, pr_door_info, pr_exit, pr_faccessat, pr_fchmod, pr_fchmodat, pr_fchown, pr_fchownat, pr_fcntl, pr_fstat, pr_fstat64, pr_fstatat, pr_fstatat64, pr_fstatvfs, pr_fstatvfs64, pr_futimens, pr_getitimer, pr_getpeername, pr_getpeerucred, pr_getrlimit, pr_getrlimit64, pr_getsockname, pr_getsockopt, pr_getzoneid, pr_ioctl, pr_lchown, pr_link, pr_linkat, pr_llseek, pr_lseek, pr_lstat, pr_lstat64, pr_memcntl, pr_meminfo, pr_mkdir, pr_mkdirat, pr_mkfifo, pr_mkfifoat, pr_mknod, pr_mknodat, pr_mmap, pr_munmap, pr_open, pr_open64, pr_openat, pr_openat64, pr_readlink, pr_readlinkat, pr_rename, pr_renameat, pr_rmdir, pr_setitimer, pr_setrlimit, pr_setrlimit64, pr_sigaction, pr_stat, pr_stat64, pr_statvfs, pr_statvfs64, pr_symlink, pr_symlinkat, pr_umask, pr_unlink, pr_unlinkat, pr_utimensat, pr_waitid - system calls executed by a victim process


#include <libproc.h>
int pr_access(ps_prochandle_t *, const char *, int);
int pr_chmod(ps_prochandle_t *, const char *, mode_t);
int pr_chown(ps_prochandle_t *, const char *, uid_t, gid_t);
int pr_close(ps_prochandle_t *, int);
int pr_door_info(ps_prochandle_t *, int, struct door_info *);
int pr_exit(ps_prochandle_t *, int);
int pr_faccessat(ps_prochandle_t *, int, const char *, int, int);
int pr_fchmod(ps_prochandle_t *, int, mode_t);
int pr_fchmodat(ps_prochandle_t *, int, const char *, mode_t, int);
int pr_fchown(ps_prochandle_t *, int, uid_t, gid_t);
int pr_fchownat(ps_prochandle_t *, int, const char *, uid_t, gid_t,
int pr_fcntl(ps_prochandle_t *, int, int, void *);
int pr_fstat(ps_prochandle_t *, int, struct stat *);
int pr_fstat64(ps_prochandle_t *, int, struct stat64 *);
int pr_fstatat(ps_prochandle_t *, int, const char *,
         struct stat *, int);
int pr_fstatat64(ps_prochandle_t *, int, const char *,
         struct stat64 *, int);
int pr_fstatvfs(ps_prochandle_t *, int, statvfs_t *);
int pr_fstatvfs64(ps_prochandle_t *, int, statvfs64_t *);
int pr_futimens(ps_prochandle_t *, int, const timespec_t[2]);
int pr_getitimer(ps_prochandle_t *, int, struct itimerval *);
int pr_getpeername(ps_prochandle_t *, int, struct sockaddr *,
         socklen_t *);
int pr_getpeerucred(ps_prochandle_t *, int, ucred_t **);
int pr_getrlimit(ps_prochandle_t *, int, struct rlimit *);
int pr_getrlimit64(ps_prochandle_t *, int, struct rlimit64 *);
int pr_getsockname(ps_prochandle_t *, int, struct sockaddr *,
         socklen_t *);
int pr_getsockopt(ps_prochandle_t *, int, int, int, void *,
         socklen_t *);
zoneid_t pr_getzoneid(ps_prochandle_t *);
int pr_ioctl(ps_prochandle_t *, int, int, void *, size_t);
int pr_lchown(ps_prochandle_t *, const char *, uid_t, gid_t);
int pr_link(ps_prochandle_t *, const char *, const char *);
int pr_linkat(ps_prochandle_t *, int, const char *, int,
         const char *, int);
offset_t pr_llseek(ps_prochandle_t *, int, offset_t, int);
off_t pr_lseek(ps_prochandle_t *, int, off_t, int);
int pr_lstat(ps_prochandle_t *, const char *, struct stat *);
int pr_lstat64(ps_prochandle_t *, const char *, struct stat64 *);
int pr_memcntl(ps_prochandle_t *, caddr_t, size_t, int, caddr_t,
         int, int);
int pr_meminfo(ps_prochandle_t *, const uint64_t *, int,
         const uint_t *, int, uint64_t *, uint_t *);
int pr_mkdir(ps_prochandle_t *, const char *, mode_t);
int pr_mkdirat(ps_prochandle_t *, int fd, const char *, mode_t);
int pr_mkfifo(ps_prochandle_t *, const char *, mode_t);
int pr_mkfifoat(ps_prochandle_t *, int, const char *, mode_t);
int pr_mknod(ps_prochandle_t *, const char *, mode_t, dev_t);
int pr_mknodat(ps_prochandle_t *, int, const char *, mode_t, dev_t);
void *pr_mmap(ps_prochandle_t *, void *, size_t, int, int, int, off_t);
int pr_munmap(ps_prochandle_t *, void *, size_t);
int pr_open(ps_prochandle_t *, const char *, int, mode_t);
int pr_open64(ps_prochandle_t *, const char *, int, mode_t);
int pr_openat(ps_prochandle_t *, int fd, const char *, int, mode_t);
int pr_openat64(ps_prochandle_t *, int fd, const char *, int, mode_t);
ssize_t pr_readlink(ps_prochandle_t *, const char *, char *, size_t);
ssize_t pr_readlinkat(ps_prochandle_t *, int, const char *,
         char *, size_t);
int pr_rename(ps_prochandle_t *, const char *, const char *);
int pr_renameat(ps_prochandle_t *, int, const char *, int,
         const char *);
int pr_rmdir(ps_prochandle_t *, const char *);
int pr_setitimer(ps_prochandle_t *, int, const struct itimerval *,
         struct itimerval *);
int pr_setrlimit(ps_prochandle_t *, int, const struct rlimit *);
int pr_setrlimit64(ps_prochandle_t *, int, const struct rlimit64 *);
int pr_sigaction(ps_prochandle_t *, int, const struct sigaction *,
         struct sigaction *);
int pr_stat(ps_prochandle_t *, const char *, struct stat *);
int pr_stat64(ps_prochandle_t *, const char *, struct stat64 *);
int pr_statvfs(ps_prochandle_t *, const char *, statvfs_t *);
int pr_statvfs64(ps_prochandle_t *, const char *, statvfs64_t *);
int pr_symlink(ps_prochandle_t *, const char *, const char *);
int pr_symlinkat(ps_prochandle_t *, const char *, int, const char *);
mode_t pr_umask(ps_prochandle_t *, mode_t);
int pr_unlink(ps_prochandle_t *, const char *);
int pr_unlinkat(ps_prochandle_t *, int, const char *, int);
int pr_utimensat(ps_prochandle_t *, int, const char *,
         const timespec_t[2], int);
int pr_waitid(ps_prochandle_t *, idtype_t, id_t, siginfo_t *, int);


The libproc library provides interfaces that enable a controlling process to force a victim process to execute system calls on behalf of the controlling process. These are enumerated above.

Almost all of these interfaces have function signatures identical to the system calls they mimic, with the addition of a ps_prochandle_t pointer as their first argument. The ps_prochandle_t pointer identifies a victim process that is being controlled by the calling process. All of the arguments are data in the controlling process. Data is copied to and from the victim process when necessary and conversion to and from 32-bit data items is performed by the library as necessary in the case of a 64-bit controlling process and a 32-bit victim process. The semantics of all of these functions are the same as the system calls they mimic.

Return Values

The return values and error conditions are the same as the system call that each function mimics. If the system call in question sets errno, the errno of the controlling process is set appropriately. The errno of the victim process remains unchanged. For more information about the system calls in question, see the appropriate man pages.


See the man pages for the system calls in question.


See attributes(7) for descriptions of the following attributes:

Interface Stability

See Also

libproc.h(3HEAD), libproc(3LIB), Pgrab(3PROC), Prelease(3PROC), Pcreate_agent(3PROC), Psyscall(3PROC)


Exceptions to the identical function signature rule are all the pr_open*() functions and the pr_ioctl() function.

Unlike the normal functions they mimic, the pr_open*() functions require the mode_t argument to be present, even if unused.

Unlike the normal ioctl() function, the pr_ioctl() function requires the third void * argument to be present and also requires an extra size_t argument that specifies the size of the object pointed to by the preceding void * argument if it is an actual pointer.