All Questions
13 questions
3
votes
1
answer
293
views
Writing a tail command clone
I'm reading Bruce Molay's book on Unix programming, and as an exercise I've implemented a copy of the tail command.
My approach goes over the entire file once, to ...
2
votes
1
answer
102
views
Rsync helper in C (Improved)
Last week I posted a previous version of this code. I improved the program and worked on it for a few days and I would love to get reviews, feedback and tips so I could learn more and more from you ...
3
votes
1
answer
227
views
UNIX cp multithreaded implementation in C
I recently finished a high school project of mine for a class revolving around creating my own multithreaded implementation of the "cp" terminal command in UNIX systems.
I am seeking for ...
4
votes
2
answers
502
views
Implementation of portscanner for a host
I have tried to check whether the ports of a host from port 0 to port 1023 is open or not. Could someone please review this code and provide feedback.
...
3
votes
1
answer
262
views
Finding the class to which the IP address belongs
I have tried the code for finding the class of the IP address the user inputs, and printing the network and the host bits in the IP address. Could someone please review this approach and provide ...
8
votes
4
answers
537
views
Implementation of system() function in Linux using fork() , exec() and waitpid() system calls
I have written the code for implementation of system() function using fork(), exec() and waitpid(). Could someone please review this code and provide feedback. Thanks a lot.
...
4
votes
2
answers
86
views
Implementation of cp program that prints the number of bytes copied
I have written the code for implementation of the cp program that prints the number of bytes copied when the user presses Ctrl-C. Could someone please review this code and provide feedback. Thanks a ...
2
votes
1
answer
47
views
Reproduce the system() function of linux
My mentor says to reproduce the system() function of Linux exactly as given in the man pages. I have written the below code. Could someone review this code and provide me any suggestions for ...
2
votes
1
answer
98
views
The code reads from a specified offset to the specified number of bytes in a file
The code reads the specified number of bytes from a specified offset in a file, I have handled the partial reads and bytes > buf_size conditions. Could anyone review the code? and say whether the ...
-2
votes
1
answer
87
views
The code reads the file from the specified offset to the specified number of bytes. How to handle errors of partial reads in reading a file [closed]
I could like to read a file from a specified offset to a certain number of bytes in a file. I would pass the filename, the offset, the number of bytes as an argument. The constraint is should use only ...
2
votes
0
answers
210
views
Blocking serial port C library
I am planning to write a reasonably feature rich serial library but wanted to cut my teeth on something fairly basic. This serial library is fairly simple. It is a thin wrapper on the UNIX open, ...
2
votes
2
answers
150
views
Set-uid root program that runs a program as the user “restrict” (follow-up)
See Set-uid root program that runs a program as the user "restrict" for context.
I've written a very short program that is intended to run the program specified in its arguments (...
1
vote
1
answer
135
views
Set-uid root program that runs a program as the user "restrict"
I've written a very short program that is intended to run the program specified in its arguments (argv) as the user named "restrict" (which exists). I want to make ...