Well, I haven't found out what is going on. But it is consistent. So I will ignore a return code of -1, but only when the errno is EPERM and the errnojr is 0x0B28E128. Best I can come up with. When I do that, I get the results that I want. Now, on to bigger and better (FSVO better) things. Such as catching signals.
On Tue, Feb 25, 2014 at 1:23 PM, John McKown <[email protected]>wrote: > I am writing a program which "daemonizes" itself. That is, if it is > invoked from a UNIX shell, it will close all the open file descriptors, do > a setsid to put itself into its own, unique, process group, and do the > "double fork()" which I read about in a advance UNIX programming book. > > If I run this program using TSO OMVS or a standard telnet connection to a > UNIX prompt, everything works well. But if I logon via an ssh tunnel to a > UNIX prompt, the code to close all descriptors: > > const int zero = 0; > const int minut_1 = -1; > ... > rc = fcntl(zero, F_CLOSFD, minus_1); > > Will return with rc == -1 (error), an errno value of 139 (EPERM) and a > errnojr value of 0x0B28E128. Looking this up with bpxmtext only says: > BPXPRIPK 07/18/08 > There is a hit on this, but for HBB7780. I'm on HBB7770 (z/OS 1.12). There > are no messages on the z/OS SYSLOG. > > Any ideas? I can just ignore the -1 return code but I really, really, > really don't like doing that. > > -- > Wasn't there something about a PASCAL programmer knowing the value of > everything and the Wirth of nothing? > > Maranatha! <>< > John McKown > -- Wasn't there something about a PASCAL programmer knowing the value of everything and the Wirth of nothing? Maranatha! <>< John McKown ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
