Sponsored Content
Full Discussion: invalid argument in semctl()
Top Forums UNIX for Advanced & Expert Users invalid argument in semctl() Post 302319549 by asimibm on Monday 25th of May 2009 02:41:29 PM
Old 05-25-2009
invalid argument in semctl()

When I am using the function semctl() it is giving me error as the INVALID ARGUMENT. Can any body give me the possible reasons???
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

stty: : Invalid argument

Hello Everyone; I have a script that is throwing the following message: stty: : Invalid argument The line that gives the message is the following, sailormoon$ scp home/voice.xml newwave@silvermoon:/newwave/config/radius stty: : Invalid argument voice.xml | ... (2 Replies)
Discussion started by: tony3101
2 Replies

2. Solaris

ps: 65535 is an invalid non-numeric argument for -p option

I want to figure out what is the reason of error message I have in Solaris 10. Why Solaris 10 dosn't recognize 65535? ps: 65535 is an invalid non-numeric argument for -p option usage: ps 'format' is one or more of: Thank you (5 Replies)
Discussion started by: gogogo
5 Replies

3. Programming

error "Invalid argument" returned after call sched_setscheduler

the code is below and the was run on Solaris 9. ----------------------------- struct sched_param param; param.sched_priority = 99; if(sched_setscheduler(0, SCHED_RR, &param) == -1) { perror("setting priority"); exit(1); } ------------------------------- after the... (1 Reply)
Discussion started by: robin.zhu
1 Replies

4. UNIX for Dummies Questions & Answers

msgrcv : Invalid argument

Hi All, Please guide me how to get rid : msgrcv : Invalid argument. I am using message queues: msgsnd and msgrcv, I am able to send through msgsnd and receive through msgrcv, but at times i get the belo error. msgrcv : Invalid argument. (1 Reply)
Discussion started by: answers
1 Replies

5. Solaris

Invalid Argument and glassfish

I tried to install glassfish on Solaris 10 and it worked fine on other instances. I got the below message bash-3.00# ./sjsas-9_1_01-solaris-sparc.bin -console bash: ./sjsas-9_1_01-solaris-sparc.bin: Invalid argument I logged on as root and the file has execute permission. So strange. Do... (1 Reply)
Discussion started by: Andrew2008
1 Replies

6. IP Networking

sendto invalid argument

Hi I lost a lot of time in understanding the message "sendto Invalid argument" when I execute the following code. This code is a simple UDP sender improved with some reliability feature. My goal is to send a file. I've reported only the code which may be useful. Can anyone help me? Thank you... (0 Replies)
Discussion started by: Puntino
0 Replies

7. UNIX for Dummies Questions & Answers

Need FIX for: RTNETLINK answers: Invalid argument

OK...I'm using the latest version of Fedora 10. My network connection was working fine, and I had several network LAN shares on my desktop. Then I rebooted the system without dismounting those shares first. ooops. <:( ...When the system came back up, my network connection was gone. All... (2 Replies)
Discussion started by: Pudnik
2 Replies

8. Programming

SIOCSARP: Invalid Argument.

Hello everybody, I've been programming an alternative to linux's standard 'arp' program. I can delete arp entries (SIOCDARP), get arp entries (SIOCGARP), but i'm having troubles setting entries with ioctl. I can't set any PERM, USETRAILERS, or COM address. It only adds PUB entries and i don't... (2 Replies)
Discussion started by: semash!
2 Replies

9. UNIX for Advanced & Expert Users

NFS : Invalid argument (Remote share mounting issue)

Hi Guru's, I am unable to mount NFS share on unix system (DG/UX) which is nfs client. Error: mount: /nfsshare: Invalid argument mount: giving up on: /mountpoint i tried following command mount -t nfs remotehost:/nfsshare /mountpoint Error: (5 Replies)
Discussion started by: Justin John
5 Replies

10. UNIX for Beginners Questions & Answers

Mount error in Linux: invalid argument

hi i have an android phone which i think is bricked, so wanted to see what the actual issue is, I flashed it with TWRP recovery image and launched terminal i, was able understand that mount is not happening, it says invalid argument and no such file or directory. Below is what i get while... (32 Replies)
Discussion started by: nanz143
32 Replies
semctl(2)							System Calls Manual							 semctl(2)

NAME
semctl - Performs semaphore control operations SYNOPSIS
#include <sys/sem.h> int semctl( int semid, int semnum, int cmd, ...); Application developers may want to specify #include statements for <sys/types.h> and <sys/ipc.h> before the one for <sys/sem.h> if programs are being developed for multiple platforms. The additional #include statements are not required on Tru64 UNIX systems or by ISO or X/Open standards, but may be required on other vendors' systems that conform to these standards. STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: semctl(): XSH4.2 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Specifies the ID of the semaphore set. Specifies the number of the semaphore to be processed. Specifies the type of command. See the DESCRIPTION section for a list of available commands. The fourth argument is optional and depends on the operation requested. If required, it is of the type union semun, which the application program must explicitly declare as follows: union semun { int val; struct semid_ds *buf; u_short *array; } arg ); The members of this structure are described as follows: Contains the semaphore value to which semval is set when the SETVAL command is performed. Points to a structure of type semid_ds. (For information about this structure, semid_ds(4).) When you specify the IPC_STAT command, semctl() copies the contents of the semid_ds struc- ture identified by semid into arg.buf. When you specify the IPC_SET command, semctl() copies the contents of the arg.buf parameter into the semid_ds structure identified by the semid parameter. Points to an array of semval values. These semval values are returned by the GETALL command and set by the SETALL command. DESCRIPTION
The semctl() function allows a process to perform various operations on an individual semaphore within a semaphore set, on all semaphores within a semaphore set, and on the semid_ds structure associated with the semaphore set. It also allows a process to remove the semaphore set's ID and its associated semid_ds structure. The cmd value determines which operation is performed. The following commands operate on the specified semaphore (that is, the one speci- fied by the semnum parameter) within the semaphore set identified by semid: Returns the value of semval. This command requires read permission. Sets the value of semval to arg.val. When this command successfully executes, the kernel clears the semaphore's adjust-on-exit value in all processes. This command requires modify permission. Returns the value of sempid. This command requires read permission. Returns the value of semncnt. This command requires read permission. Returns the value of semzcnt. This command requires read permission. The following commands operate on all the semaphores in the semaphore set: Returns all the semval values and places them in the array pointed to by arg.array. This command requires read permission. Sets all the semval values according to the array pointed to by arg.array. When this command successfully executes, the kernel clears the semaphore's adjust-on-exit value in all processes. This command requires modify permission. You can also use the following IPC commands: Queries the semaphore ID by copying the contents of its associated semid_ds structure into the structure pointed to by arg.buf. This com- mand requires read permission. Sets the semaphore set by copying the values in the arg.buf structure into corresponding fields in the semid_ds structure associated with the semaphore ID. This operation is restricted. The effective user ID of the calling process must have superuser privilege or must be equal to the value of sem_perm.cuid or sem_perm.uid in the structure associated with the semaphore ID. The fields are set as follows: The sem_perm.uid field is set to the owner's user ID. The sem_perm.gid field is set to the owner's group ID. The sem_perm.mode field is set to the access modes for the semaphore set. Only the low-order nine bits are set. Removes the semaphore ID and destroys the set of semaphores and the semid_ds data structure associated with it. This operation is restricted. The effective user ID of the calling process must have superuser privilege or equal to the value of sem_perm.cuid or sem_perm.uid in the associated semid_ds structure. RETURN VALUES
Upon successful completion, the value returned depends on the cmd parameter as follows: Returns the value of semval. Returns the value of sempid. Returns the value of semncnt. Returns the value of semzcnt. All other commands return a value of 0 (zero). If the semctl() function fails, it returns a value of -1 and sets errno to indicate the error. ERRORS
The semctl() function sets errno to the specified values for the following conditions: The calling process does not have the required per- mission. [Tru64 UNIX] The cmd parameter is IPC_STAT or IPC_SET and an error occurred in accessing the arg structure. The semid parameter is not a valid semaphore ID; the value of semnum is less than 0 (zero) or greater than sem_nsems; or cmd is not a valid command. [Tru64 UNIX] The system does not have enough memory to complete the function. Either the cmd parameter is equal to IPC_RMID and the effective user ID of the calling process does not have appropriate privilege, or the cmd parameter is equal to IPC_SET and the effective user ID of the calling process is not equal to the value of sem_perm.cuid or sem_perm.uid in the semid_ds structure associated with the semaphore ID. The cmd parameter is SETVAL or SETALL and the value to which semval is to be set is greater than the system-defined maximum. RELATED INFORMATION
Functions: semget(2), semop(2) Data structures: semid_ds(4) Standards: standards(5) delim off semctl(2)
All times are GMT -4. The time now is 10:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy