bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: get_ppid_of: Add support for DragonFly BSD
Date: Tue, 08 Jun 2021 03:42:28 +0200	[thread overview]
Message-ID: <1757875.yyWyyPTcbl@omega> (raw)

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];



                 reply	other threads:[~2021-06-08  1:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1757875.yyWyyPTcbl@omega \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).