Find Jobs
Hire Freelancers

C programming

$5-10 USD

Ολοκληρώθηκε
Αναρτήθηκε περίπου 21 χρόνια πριν

$5-10 USD

Πληρωμή κατά την παράδοση
Introduction: The exec system call overlays a new program into a process. The fork and exec combination is used very frequently in UNIX to spawn a new process and to overlay a new program. A common example is trying a shell command at a shell prompt. The shell forks a new process which starts with a shell image, then makes an exec call to overlay the shell image the shell command. Complete the following skeleton C program for spawning a process and starting a new program. /*This program reads a command line from the terminal and executes it*/ #include/*declare functionm protocols here*/ /*the main fuction is given as follows main() { char*line [132]; char*command; char**argv; int pid; while(1) { if(gets(line)==0)exit(0); if(strlen(line)==0)continue; parse_command(line, command, &argv); pid = start_command(command, argv); if(pid>0)wait(0); } } /*Your job is to complete two functions: parse_command, start_command, and child*/ /*1. write a function to parse command*/ void parse_command (char[] line,char*command, char**argv) { } /*2. complete the start_command function*/ int start_command(char*command, char**argv) { int pid; /*return value of fork call //Create child process ....... if(pid==0){ /* invoke the child function here*/ } else if (pid<0){ /*print out fork error message*/ } return pid; } /*3. Complete child function*/ void child(char*command, char**argv){ int status; /*status will store the return value of an execvp system call*/ /*EXEC new command in child process by invoking execvp system call*/ ...... /*If exec was successful, this code will not be executed.*/ if(status<0){ /*print error message: a wrong command*/ } exit(0); } ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bi request. 3) Complete ownership and distribution copyrights to all work purchased. ## Platform C programming only
Ταυτότητα εργασίας: 2907729

Σχετικά με την εργασία

6 προτάσεις
Απομακρυσμένη Εργασία
Ενεργός/ή 21 χρόνια πριν

Ψάχνεις τρόπο για να κερδίσεις μερικά χρήματα;

Πλεονεκτήματα πλειοδοσίας στο Freelancer

Καθόρισε τον προϋπολογισμό σου και το χρονοδιάγραμμα
Πληρώσου για τη δουλειά σου
Περίγραψε την πρόταση σου
Η εγγραφή και η πλειοδοσία σε εργασίες είναι δωρεάν
Βραβεύτηκε στον/στην:
Avatar Χρήστη
See private message.
$5 USD σε 14 ημέρες
4,9 (79 αξιολογήσεις)
4,7
4,7
6 freelancers δίνουν μια μέση προσφορά $7 USD για αυτή τη δουλειά
Avatar Χρήστη
See private message.
$8,50 USD σε 14 ημέρες
4,9 (175 αξιολογήσεις)
5,9
5,9
Avatar Χρήστη
See private message.
$7,65 USD σε 14 ημέρες
4,9 (68 αξιολογήσεις)
4,8
4,8
Avatar Χρήστη
See private message.
$6,80 USD σε 14 ημέρες
4,8 (14 αξιολογήσεις)
4,5
4,5
Avatar Χρήστη
See private message.
$5,95 USD σε 14 ημέρες
4,9 (10 αξιολογήσεις)
2,5
2,5
Avatar Χρήστη
See private message.
$8,50 USD σε 14 ημέρες
5,0 (4 αξιολογήσεις)
1,3
1,3

Σχετικά με τον πελάτη

Σημαία της UNITED STATES
United States
5,0
1
Μέλος από Ιαν 29, 2003

Επαλήθευση Πελάτη

Ευχαριστούμε! Σου έχουμε στείλει ένα email με ένα σύνδεσμο για να διεκδικήσεις τη δωρεάν πίστωση σου.
Κάτι πήγε στραβά κατά την προσπάθεια αποστολής του email σου. Παρακαλούμε δοκίμασε ξανά.
Εγγεγραμμένοι Χρήστες Συνολικές Αναρτημένες Δουλειές
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Φόρτωση προεπισκόπησης
Δόθηκε πρόσβαση για Geolocation.
Η σύνδεση σου έχει λήξει και τώρα έχεις αποσυνδεθεί. Παρακαλούμε συνδέσου ξανά.