diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2025-04-02 06:02:35 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska@appnovation.com> | 2025-04-02 06:02:35 +0000 |
| commit | 200a70765a503fc94b546e5a52fdd90a59eee3b3 (patch) | |
| tree | 343e317b83e45454239cdb50a50b3649bcdc174f /src/sysdeps/trykernprocpathname.c | |
| parent | 56ab53289c60c6fbb06f8d548d353535d5ed1140 (diff) | |
| download | skalibs-200a70765a503fc94b546e5a52fdd90a59eee3b3.tar.gz | |
Add sagetexecname() and all the necessary infrastructure
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/sysdeps/trykernprocpathname.c')
| -rw-r--r-- | src/sysdeps/trykernprocpathname.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/sysdeps/trykernprocpathname.c b/src/sysdeps/trykernprocpathname.c new file mode 100644 index 0000000..b8e2867 --- /dev/null +++ b/src/sysdeps/trykernprocpathname.c @@ -0,0 +1,18 @@ +/* ISC license. */ + +#undef _POSIX_C_SOURCE +#undef _XOPEN_SOURCE + +#include <sys/types.h> +#ifdef __NetBSD__ +#include <sys/param.h> +#endif +#include <sys/sysctl.h> + +int main (void) +{ + int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 } ; + char buf[1024] ; + size_t len = sizeof(buf) ; + return sysctl(mib, 4, buf, &len, 0, 0) >= 0 ; +} |
