site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=3K8D3PLaXnYIRKeqJZi5NOFSTZQfH6WbAmONwBLNPmU=; b=juSWdIskdLmsmRxBS/uTcY2yMMR9e/OOaDf6fav/XNN6ai/lJUGH9DTHDUKaYQWeB9 gL5Xao+RS7R6v9XXH1k3dZGkW9RXNO8/4vm/6dH9PacCctfRDBgaUENEQeg9TRx7Xnum aCEXG6V6CUlJaQHf/xy0kjICnlRoPeokc5+cY= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Tmaww/Up+Z3LbNagdrqWQ4KfEsp/DqeOH3wx8GuvB6QyGytD+JeX4FmjLc4JL/3VJ0 XynStDMJFOp5h+Zp3YzET2PeE879u/6QEiPUTsnHSnmjKGbakqTWgwiu+dMIIbL68j2/ yMKL/3pHBExI6z0Wiu4lCaqeZLKS3/NHENS5c= Hello All, I am using shmget() to allocate shared memory in my backup/restore utility. int shmget(key_t key, size_t size, int shmflg); The size and shmflg I am passing are always constant. If shmget() returns EEXIST I try again with another key until shared memory is allocated. On some occasions, shmget() fails and I am getting an EINVAL error. I dont think the arguments are invalid because, I am using constant values for size and shmflg for every call and most of the calls are successful. The Man page says this for EINVAL : [EINVAL] No shared memory segment is to be created, and a shared memory segment exists for key, but the size of the segment associated with it is less than size, which is non-zero. nonzero. zero. However, with every shmget() call, I use the same size 524288 and same flags with different key ofcourse. Then why should I get an EINVAL ? Is it possible that another application is allocating shared memory using this key but a size lesser than 524288 ? Along with checking EEXIST for existence of a memory location with this key should I also check for EINVAL ? That is if EINVAL is returned, should I try to allocate with another key ? Thanks, Rohan _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com