From owner-freebsd-stable@FreeBSD.ORG Mon May 26 17:14:45 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0994B1065678 for ; Mon, 26 May 2008 17:14:45 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from mx.bulinfo.net (mx.bulinfo.net [193.194.156.1]) by mx1.freebsd.org (Postfix) with ESMTP id B4C828FC27 for ; Mon, 26 May 2008 17:14:44 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from localhost (localhost [127.0.0.1]) by mx.bulinfo.net (Postfix) with ESMTP id 9631C64D79 for ; Mon, 26 May 2008 20:14:41 +0300 (EEST) Received: from mx.bulinfo.net ([127.0.0.1]) by localhost (mx.bulinfo.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 30945-06 for ; Mon, 26 May 2008 20:14:40 +0300 (EEST) Received: from [192.168.2.188] (pythia.bulinfo.net [212.72.195.5]) by mx.bulinfo.net (Postfix) with ESMTP id C4CC564D6E for ; Mon, 26 May 2008 20:14:40 +0300 (EEST) Message-ID: <483AEFFE.8080302@bulinfo.net> Date: Mon, 26 May 2008 20:14:38 +0300 From: Krassimir Slavchev User-Agent: Thunderbird 2.0.0.9 (X11/20071122) MIME-Version: 1.0 To: FreeBSD X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at mx.bulinfo.net Subject: shmat() return values? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2008 17:14:45 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, When I try: if ((*shm = shmat(shmid, NULL, 0)) == -1) The gcc complains with: warning: comparison between pointer and integer shmat() is declared in shm.h as: void *shmat(int, const void *, int); but 'man 4 shmat; RETURN VALUES Upon success, shmat() returns the address where the segment is attached; otherwise, -1 is returned and errno is set to indicate the error. What is the correct return value on failure, -1 or NULL? I think it should be NULL? Best Regards -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFIOu/+xJBWvpalMpkRAjZUAJ9UWQhOaUw/xtoNTfMydiudWv7apwCaAomp gJhTr9Iwh0jalQL+r8KwKdY= =m30h -----END PGP SIGNATURE-----