bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* get_ppid_of: Add support for DragonFly BSD
@ 2021-06-08  1:42 Bruno Haible
  0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2021-06-08  1:42 UTC (permalink / raw)
  To: bug-gnulib

DragonFly BSD has a /proc/<pid>/status file that looks like the FreeBSD one.


2021-06-07  Bruno Haible  <bruno@clisp.org>

	get_ppid_of: Add support for DragonFly BSD.
	* lib/get_ppid_of.c: Treat DragonFly BSD like FreeBSD.

diff --git a/lib/get_ppid_of.c b/lib/get_ppid_of.c
index ed9f25f..f153b75 100644
--- a/lib/get_ppid_of.c
+++ b/lib/get_ppid_of.c
@@ -23,7 +23,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#if defined __linux__ || defined __ANDROID__ || (defined __FreeBSD_kernel__ && !defined __FreeBSD__) || defined __GNU__ || defined __FreeBSD__ || defined __NetBSD__ || defined __minix || defined __sun /* Linux, GNU/kFreeBSD, GNU/Hurd, FreeBSD, NetBSD, Minix, Solaris */
+#if defined __linux__ || defined __ANDROID__ || (defined __FreeBSD_kernel__ && !defined __FreeBSD__) || defined __GNU__ || defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__ || defined __minix || defined __sun /* Linux, GNU/kFreeBSD, GNU/Hurd, FreeBSD, NetBSD, Minix, Solaris */
 # include <fcntl.h>
 # include <unistd.h>
 #endif
@@ -108,7 +108,7 @@ get_ppid_of (pid_t pid)
 
 #endif
 
-#if defined __FreeBSD__ || defined __NetBSD__               /* FreeBSD, NetBSD */
+#if defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__ /* FreeBSD, NetBSD */
 
   /* Read the contents of /proc/<pid>/status into memory.  */
   char filename[6 + 10 + 7 + 1];



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-08  1:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-08  1:42 get_ppid_of: Add support for DragonFly BSD Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).