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

Join 107,639 Programmers for FREE! Ask your question and get quick answers from experts. There are 956 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



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: 18


My Contributions


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

Fast ReplyReply to this topicStart new topic
Time is now: 8/29/08 06:42PM

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