32 #include <sys/types.h>
33 #include <sys/socket.h>
34 #include <sys/ioctl.h>
36 #include <netinet/in.h>
37 #include <netinet/in6_var.h>
38 #include <arpa/inet.h>
46 #include <sys/protosw.h>
49 #include <sys/procfs.h>
53 #include <sys/pollset.h>
56 #include <sys/mntctl.h>
57 #include <sys/vmount.h>
60 #include <sys/vnode.h>
65 read_wall_time(&t, TIMEBASE_SZ);
66 time_base_to_time(&t, TIMEBASE_SZ);
67 return (
uint64_t) t.tb_high *
G + t.tb_low;
82 char abspath[PATH_MAX];
90 res = getargs(&pi,
sizeof(pi),
args,
sizeof(
args));
103 if (strchr(
args,
'/') != NULL) {
104 if (realpath(
args, abspath) != abspath)
107 abspath_size = strlen(abspath);
110 if (*
size > abspath_size)
111 *
size = abspath_size;
119 char trypath[PATH_MAX];
120 char *clonedpath = NULL;
128 if (clonedpath == NULL)
131 token = strtok(clonedpath,
":");
132 while (token != NULL) {
133 snprintf(trypath,
sizeof(trypath) - 1,
"%s/%s", token,
args);
134 if (realpath(trypath, abspath) == abspath) {
137 abspath_size = strlen(abspath);
140 if (*
size > abspath_size)
141 *
size = abspath_size;
150 token = strtok(NULL,
":");