[PATCH] D82282: [AIX] Implement wait4
Serge Pavlov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 22 10:45:01 PDT 2020
sepavloff marked 3 inline comments as done.
sepavloff added a comment.
Could you please select 'Commandeer Revision' in the 'Add Action' field? You will be able to rule this patch.
================
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,
----------------
hubert.reinterpretcast wrote:
> 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.
Yes, it is protection against definition of `wait4` as a macro. Such conflicts may give weird diagnostics.
================
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);
----------------
hubert.reinterpretcast wrote:
> 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.
>
Yes, please. I don't have access to AIX and cannot check patch.
================
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) {
----------------
hubert.reinterpretcast wrote:
> To avoid interpretation of `wait4` as a function-like macro, it can be placed in parentheses: `(wait4)`.
Interesting solution, thank you!
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