SHMOP (SYSV)

BostonU SysMgr root%bostonu.csnet at CSNET-RELAY.ARPA
Wed Oct 23 07:52:34 AEST 1985


Ok, nobody leave the room...someone call the UNIX police...

>From SHMOP(2):

char *shmat(...)
...

Upon successful completion, the return value is as follows:

	Shmat returns the data segment start address of the
	attached shared memory segment
...
Otherwise, a value of -1 is returned...
---
Yup, sure does, about the only one like it I know of, test has to go
something like:

	if(((int) (foo = (footype) shmat(args))) == -1) error...

anyone know any good reason why it (peculiarly) doesn't return NULL on
failure? Even that use of an (int) cast isn't quite right, long may be
closer, maybe, or some union tomfoolery. I would understand if this
were old but it isn't. I doubt very much NULL is a reasonable return
value on success. (note: SYSVR2/3B2 if it makes any difference.)

	-Barry Shein, Boston University



More information about the Comp.unix.wizards mailing list