From owner-freebsd-hackers Fri Dec 22 06:14:11 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id GAA26826 for hackers-outgoing; Fri, 22 Dec 1995 06:14:11 -0800 (PST) Received: from sunland.gsfc.nasa.gov (sunland.gsfc.nasa.gov [128.183.22.16]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id GAA26818 for ; Fri, 22 Dec 1995 06:14:09 -0800 (PST) Received: by sunland.gsfc.nasa.gov (8.6.8/1.35) id JAA07674; Fri, 22 Dec 1995 09:14:02 -0500 Date: Fri, 22 Dec 1995 09:14:02 -0500 From: tsingle@sunland.gsfc.nasa.gov (Tim Singletary) Message-Id: <199512221414.JAA07674@sunland.gsfc.nasa.gov> To: hackers@freebsd.org Subject: Re: semctl() portability issue and fix Sender: owner-hackers@freebsd.org Precedence: bulk I inadvertently inserted the wrong version of semctl() in my previous version. What I'm actually using is: -begin-------------- #include #include #include #include int semctl(int semid, int semnum, int cmd, ...) { va_list ap; union semun fourth_arg; union semun *fourth_arg_ptr; va_start(ap,cmd); if (cmd == IPC_SET || cmd == IPC_STAT || cmd == GETALL || cmd == SETVAL || cmd == SETALL) { fourth_arg = va_arg(ap, union semun); } fourth_arg_ptr = &fourth_arg; va_end(ap); return (semsys(0, semid, semnum, cmd, fourth_arg_ptr)); } -end---------------- tim