FreeBSD Bugzilla – Attachment 136435 Details for
Bug 181659
[patch] devel/android-tools-adb: get rid of /proc dependency
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
no_procfs.diff
no_procfs.diff (text/plain), 599 bytes, created by
Jan Beich
on 2013-08-29 19:40:00 UTC
(
hide
)
Description:
no_procfs.diff
Filename:
MIME Type:
Creator:
Jan Beich
Created:
2013-08-29 19:40:00 UTC
Size:
599 bytes
patch
obsolete
>--- get_my_path_freebsd.c~ >+++ get_my_path_freebsd.c >@@ -18,19 +18,18 @@ > */ > > #include <sys/types.h> >+#include <sys/sysctl.h> > #include <unistd.h> >-#include <limits.h> >-#include <stdio.h> > > void > get_my_path(char *exe, size_t maxLen) > { >- char proc[64]; >+ int mib[] = { >+ CTL_KERN, >+ KERN_PROC, >+ KERN_PROC_PATHNAME, >+ getpid() >+ }; > >- snprintf(proc, sizeof(proc), "/proc/%d/file", getpid()); >- >- int err = readlink(proc, exe, maxLen - 1); >- >- exe[err > 0 ? err : 0] = '\0'; >+ sysctl(mib, sizeof(mib)/sizeof(mib[0]), exe, &maxLen, NULL, 0); > } >-
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 181659
: 136435