Skip to content

systems programming using the operating system services (system calls) POSIX 1003 1

Notifications You must be signed in to change notification settings

franlu/POSIX_1003_1

Repository files navigation

========================================================================
==============================  task_01.c  =============================
========================================================================

A program that accepts as argument a "pathname", open the file
and using a partition size of the file bytes of 80 bytes, create an 
output file in which shall contain the following:

Block 1
// the first 80 Bytes
Block 2
// the next 80 Bytes

Failure to pass an argument to the program must use standard input as 
input file.

========================================================================
=============================  task_01_a.c  ============================
========================================================================

Edit the file task_1.c so that once the writing in the output file and 
before closing, we could indicate in its first line the number of labels
"block i " had written that looks like this:

The number of blocks is <number_blocks>
Block 1
// the first 80 bytes
Block 2
// the next 80 bytes

========================================================================
==============================  task_02.c  =============================
========================================================================

A macro in C that implements the macro S_ISREG (mode) using the flags 
for it <sys/stat.h> defined for the st_mode field of struct stat. 

# define S_ISREG2 (mode) ...

========================================================================
==============================  task_03.c  =============================
========================================================================

This program is designed to supply to first create a program with the 
FILE CREATION and do a ls-l to look at the permissions and understand 
the call umask.

Secondly (after the files are created) a second program with the part of
CHANGE OF PERMISSIONS to understand the change of permissions on the 
permissions you currently have a file against an absolute setting
permissions._

========================================================================
==============================  task_04.c  =============================
========================================================================

A program using system calls necessary to accept as input:
 - An argument represents the 'pathname' of a directory.
 - Another argument which is a 4-digit octal number (similar to that can
   be used to change the permissions on the system call chmod)

The program must use the octal number indicated in the second argument 
to change the permissions of all files found in the directory indicated 
in the first argument.

The program should provide the standard output a line for each file in 
the directory that is formed by:
	<file_name>: <old_permits> <new_permits>

If you can not change the permissions of a given file must specify the 
following information on the stardard output:
	<file_name>: <errno> <new_permits>

========================================================================
==============================  task_05.c  =============================
========================================================================

task_5 have two files:
task_5_a.c - consumer process run: consumerFIFO &
task_5_b.c - producer process run: producerFIFO <message>

Task_5 use a FIFO file, the consumer process read the message of producer
process

========================================================================
==============================  task_06.c  =============================
========================================================================

A pipe example program

========================================================================
==============================  task_07.c  =============================
========================================================================

A pipe example program and input-output standard redirection:
"ls | sort"

========================================================================
==============================  task_08.c  =============================
========================================================================

Working with system calls Process Subsystem POSIX 2.10
A pipe example program and input-output standard redirection:
"ls | sort"
using the call dup2

========================================================================
==============================  task_09.c  =============================
========================================================================

Test the program, then delete the comments (1) and try it again.Try to
understand what happens to the variables and especially with messages on
screen when the kernel is on / off the buffering mechanism.

========================================================================
==============================  task_09_a.c  ===========================
========================================================================

A program to launch five child processes. Each is identified
in the standard output, showing a message like I am the son PID. The
parent process will simply have to wait for the completion of all their
children and each time it detects the end of one of his children written
to standard output a message like:
        My son just finished with <PID> 
        I only have <NUM_HIJOS> living children.

========================================================================
==============================  task_09_b.c  ===========================
========================================================================

This program is a modification of the previous task in which the parent
process waiting children first created in order odd (1st, 3rd, 5th) and
then the children peer (2nd & 4th).

About

systems programming using the operating system services (system calls) POSIX 1003 1

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages