Welcome to Dream.In.Code
Getting Help is Easy!

Join 86,374 Programmers. There are 1,406 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

operating systems

 
Reply to this topicStart new topic

operating systems

aamir_mustafa2007@msn.com
post 27 Apr, 2008 - 03:11 AM
Post #1


New D.I.C Head

*
Joined: 3 Jul, 2007
Posts: 12



What would be the output of the following code segment, if the current working directory contains the following files and directories: .bashrc, .profile, .private, test.c, main.c, courses, personal. (5 marks)

main()
{
pid_t childpid;

childpid = fork();
if (childpid == -1) {
printf(“fork failed.\n”);
exit(1);
}
if (childpid == 0) {
if (execlp (“/bin/ls”, “ls ./”, NULL) < 0) {
printf(“exec failed.\n”);
exit(1);
}
}
}
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


Fast ReplyReply to this topicStart new topic
Time is now: 5/17/08 02:45AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month