Re: How can I get the maximum shared memory segment size in program?
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:received:received:cc:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; bh=T/xkA6oC2YqdsjuX3w4QESzG0coFSdS4FOTnjf8+BdQ=; b=dJ5Bnoi/2HS6+gN7bZgR9/7Yeqtip4zBozgIaUvynZxOsmbFOzIbddG2eOzm1wjIwE0vydLviiAQnY/LjTjnl3WuMIq8zgOkTezGJGp2qLlWpKBFI3iL1CGdpB4zrcGtoqHySnd3F3piGN7UO8ANcLZBRDC70u5Ev0CoNHj04rc= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; b=uGFsEXsSTRa/2I5E+FAGIJwWAdDTdjj0Tnr9gHC5qXjguopR3ruD3P3ss9dM6CseIsiqI9AtmDR4zQM+NuYP3+2YZaZ9ilTgID2gkeSoDTfSO3eUNywrWUYuVbxduBcFCvO6pcD7eaJwWBgfaOKbYvIv5KxHtRdhvNjVowIVBaQ= Terry, You are right. On Dec 31, 2007, at 4:38 AM, Terry Lambert wrote: -- Terry By the way, my system is Leopard. _______________________________________________ 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... In my original codes, I declared shmmax variable as long. And sysctlbyname can't return the correct value. After I changed shmmax to long long. sysctlbyname return the exact value as sysctl command. Then my question is how can I know the exact type of each return value for kinds of keys? Although I can know some information from "man 8 sysctl", I don't know the exact type of the integer/string/struct, like whether integer is long long , long or something else. You did not provie the types of len or shmmax, nor whether or not len contains sizeof(shmmax), nor whether you are calling this from a 32 or 64 bit program. But I suspect you are passing the wrong type and size in to the sysctlbyname() call. On Dec 28, 2007, at 9:34 PM, bady yu <bady.yu@gmail.com> wrote: I can use "sysctl kern.sysv.shmmax" or "ipcs -M" to get the integer(4194304). But they are both command line tools. It is not convenient to call it inside the problem. I also have tried to use the sysctlbyname system call: sysctlbyname("kern.sysv.shmmax", &shmmax, &len, NULL, NULL). Although this call return 0, the shmmax variable does not hold the correct value. Can anybody tell me an appropriate way? Thank you in advance! _______________________________________________ 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/tlambert %40apple.com This email sent to tlambert@apple.com This email sent to site_archiver@lists.apple.com
participants (1)
-
bady yu