return sem_buildid(id, sma->sem_perm.seq); 
return sma->sem_id; 
static int newary (key_t key, int nsems, int semflg){	int id;	int retval;	struct sem_array *sma;	int size;	if (!nsems)		return -EINVAL;	if (used_sems + nsems > sc_semmns)		return -ENOSPC;	size = sizeof (*sma) + nsems * sizeof (struct sem);	sma = ipc_rcu_alloc(size);	if (!sma) {		return -ENOMEM;	}	memset (sma, 0, size);	sma->sem_perm.mode = (semflg & S_IRWXUGO);	sma->sem_perm.key = key;	sma->sem_perm.security = NULL;	retval = security_sem_alloc(sma);	if (retval) {		ipc_rcu_putref(sma);		return retval;	}	id = ipc_addid(&sem_ids, &sma->sem_perm, sc_semmni);	if(id == -1) {		security_sem_free(sma);		ipc_rcu_putref(sma);		return -ENOSPC;	}	used_sems += nsems;	sma->sem_base = (struct sem *) &sma[1];	/* sma->sem_pending = NULL; */	sma->sem_pending_last = &sma->sem_pending;	/* sma->undo = NULL; */	sma->sem_nsems = nsems;	sma->sem_ctime = get_seconds();	sem_unlock(sma);	return sem_buildid(id, sma->sem_perm.seq);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/19b4946ca9d1e35d4c641dcebe27378de34f3ddd/sem.c/buggy/ipc/sem.c