[PATCH] D82282: [AIX] Implement wait4

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 22 09:07:39 PDT 2020


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/lib/Support/Unix/Program.inc:332
 
+#if defined(_AIX) && !defined(wait4)
+extern pid_t kwaitpid(int *stat_loc, pid_t pid, int options,
----------------
Is this meant to protect against `wait4` as a function-like macro or also as an object-like macro? If the former, an alternate approach (see comment below) would work.


================
Comment at: llvm/lib/Support/Unix/Program.inc:333
+#if defined(_AIX) && !defined(wait4)
+extern pid_t kwaitpid(int *stat_loc, pid_t pid, int options,
+                      struct rusage *ru_loc, siginfo_t *infop);
----------------
I asked around and the `kwaitpid` interface may be subject to change.

I was told that `wait4` is actually available (just not listed in the documentation), and I was able to find the symbol in the system libc. Declaring the signature below with `extern "C"` should be enough.

If you prefer, I will put that fix in. Please let me know; thanks.



================
Comment at: llvm/lib/Support/Unix/Program.inc:335
+                      struct rusage *ru_loc, siginfo_t *infop);
+static pid_t wait4(pid_t pid, int *status, int options,
+                   struct rusage *usage) {
----------------
To avoid interpretation of `wait4` as a function-like macro, it can be placed in parentheses: `(wait4)`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82282/new/

https://reviews.llvm.org/D82282





More information about the llvm-commits mailing list