Using C language to use system calls


 
Thread Tools Search this Thread
Homework and Emergencies Homework & Coursework Questions Using C language to use system calls
# 8  
Old 11-22-2012
Quote:
Originally Posted by femchi
Code:
execl("/usr/bin/find","find . -maxdepth 1 -perm 644",(char *)NULL);

it doesnt work properly. do you know what is the problem?
Like they said, it's not a shell, it doesn't split for you.

Also, if it did work, your program would immediately quit, because execl doesn't launch a new program -- it replaces your current program. If you want to create a new process, you have to fork first, then exec. Watch the return value of fork carefully. It creates a clone of your process, and its return value is the only thing which tells them which is which. You have to make sure your child process only does what the child should be doing and not anything else, make sure it quits if exec doesn't work and such.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

System calls and C language low-level qualities???

Hi friends, I hope everyone is fine and doing well. I queried in my previous thread about the low-level qualities of C/C++ languages.I really thank you people for explaining, it was really helpful. One more ambiquity that I have in my mind is regarding the unix system calls like open, creat,... (1 Reply)
Discussion started by: gabam
1 Replies

2. Programming

Are system calls in c language only????

Hi friends, I have three questions. 1) What are system calls? 2) Is it necessary that system calls be in c language (in unix operating system)? 3) Importance of c language when programming in unix environment??? Looking forward to your wonderful replies! ... (2 Replies)
Discussion started by: gabam
2 Replies

3. UNIX for Dummies Questions & Answers

system calls in C

Hello, how would i be able to call ps in C programming? thanks, ---------- Post updated at 01:39 AM ---------- Previous update was at 01:31 AM ---------- here's the complete system call, ps -o pid -p %d, getpit() (2 Replies)
Discussion started by: l flipboi l
2 Replies

4. UNIX for Dummies Questions & Answers

About system calls.

Hi all, I am new here . I want to know about system call in detail. As system calls are also function .How system identifies it.:) (2 Replies)
Discussion started by: vishwasrao
2 Replies

5. BSD

system calls

what is the functions and relationship between fork,exec,wait system calls as i am a beginer just want the fundamentals. (1 Reply)
Discussion started by: sangramdas
1 Replies

6. Programming

System calls

why user is not able to switch from user to kernel mode by writing the function whose code is identical to system call. (1 Reply)
Discussion started by: joshighanshyam
1 Replies

7. UNIX Desktop Questions & Answers

Using system calls

Hi, I'm new to UNIX system calls. Can someone share your knowledge as to how exactly system calls should be executed? Can they be typed like commands such as mkdir on the terminal itself? Also, are there any websites which will show me an example of the output to expect when a system call like... (1 Reply)
Discussion started by: ilavenil
1 Replies

8. Solaris

System calls ?

where can i find the differences in System calls between solaris and aix? also is it possible to find a comprehensive list of them? (1 Reply)
Discussion started by: TECHRAMESH
1 Replies

9. UNIX for Dummies Questions & Answers

System calls?

open, creat, read, write, lseek and close Are they all primitive? :confused: *Another Question: is there a different between a system call, and an i/o system call? (2 Replies)
Discussion started by: PlunderBunny
2 Replies

10. UNIX for Dummies Questions & Answers

System calls for cp and mv

Which system calls are made for operations cp and mv (2 Replies)
Discussion started by: gaurava99
2 Replies
Login or Register to Ask a Question
sysman_menu(8)						      System Manager's Manual						    sysman_menu(8)

NAME
sysman_menu - Graphical interface to run system management tasks SYNOPSIS
/usr/sbin/sysman [-ui cui | gui] [-display displayname] [-menu] /usr/sbin/sysman [-accel] <accelerator> [arguments] /usr/sbin/sysman [-menu] <name> [arguments] /usr/sbin/sysman [-menu] -list /usr/sbin/sysman [-menu] -help | -h /usr/sbin/sysman -focus hostname OPTIONS
Specifies the user interface to be invoked. The choices are: Specifies command line interface. Specifies graphical user interface. Speci- fies the display screen on where sysman_menu displays its window. If the display option is not specified, sysman_menu uses the display screen specified by your DISPLAY environment variable. The display option has the format hostname:server.number. The default is :0.0. For more information, see the X(1X) reference page. In a TruCluster environment, some management tasks effect the cluster as a whole and some are local to a specific cluster member. If a task requires focus, the "Choose a host to manage" dialog box will be displayed. To launch the task directly, bypassing this dialog box, you can specify the -focus option. Directly invokes the task with that accelerator. Any arguments are passed on to the task itself. Use sysman -list for a list of the accelerators. If the accelerator is for a branch of the menu and not an executable task, then the menu hierarchy is expanded to display the con- tents of the specified branch. Same as -accel option but the name of the task as displayed in the SysMan Menu is specified. For example, sysman -menu "Manage local users". Any arguments are passed on to the task itself. The name is for a branch of the menu and not an executable task, then the menu hierarchy is expanded to display the contents of the specified branch. Displays a list of all the tasks that can be run from the SysMan Menu and their accelerators. Displays help for the SysMan Menu. DESCRIPTION
SysMan Menu is used by the system administrator to obtain system management data and run selected system management tasks. SysMan Menu pro- vides a menu of system management tasks in a tree type display, with branches of management categories and leaves of actual tasks. Select- ing a leaf or tasks invokes a task, which displays a dialog for performing the task. SysMan Menu and its associated tasks can be run on an X Windows display, a terminal with curses capability, locally on a PC, or from a Web browser. For detailed information in running SysMan Menu from a PC or a Web browser, please use your Web browser and go to: http://your_machine_name:2301/SYSMAN/index.html. Online help is available for the SysMan Menu. To get help, select the Help button. RESTRICTIONS
You must have root privileges to perform most tasks with this application. You can grant root privileges for specific users or groups of users using the Division of Privileges (DOP) application. See the dop(8) reference page and the online help in the sysman dopconfig appli- cation for additional information. You must have the root privileges to execute some of the tasks on the SysMan Menu. EXAMPLES
The following example shows how to launch the Manage local users task from the command line using an accelerator name: sysman -accel users The following example shows how to invoke SysMan Menu in curses mode: sysman -ui cui The following example shows how to get a listing of tasks and their accelerators: sysman -list The following example, displays the status of the NFS related daemons on a remote cluster mem- ber: sysman -focus nfs_config_status SEE ALSO
Commands: sysman_station(8), sysman_cli(8), sysman_clone(8), sysman(8) System Administration http://your_machine_name:2301/SYSMAN/index.html sysman_menu(8)