AOS 1 To 25
AOS 1 To 25
Q.1] Take multiple files as Command Line Arguments and print their inode numbers
and file types
Ans :-
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
return 0;
}
Q.2] Write a C program to send SIGALRM signal by child process to parent process
and parent process
make a provision to catch the signal and display alarm is fired.(Use Kill, fork,
signal and sleep
system call).
Ans :-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
int main() {
// Register the signal handler for SIGALRM
signal(SIGALRM, handle_alarm);
if (pid < 0) {
// Fork failed
perror("Fork failed");
exit(EXIT_FAILURE);
}
if (pid == 0) {
// Child process
printf("Child process: Sending SIGALRM to parent process\n");
sleep(2); // Simulate some work in the child process
kill(getppid(), SIGALRM); // Send SIGALRM to parent process
exit(0);
} else {
// Parent process
printf("Parent process: Waiting for SIGALRM\n");
sleep(5); // Parent process waits for the signal to arrive
wait(NULL); // Wait for the child to finish
printf("Parent process: Exiting\n");
}
return 0;
}
Slip-2
Q.1] Write a C program to find file properties such as inode number, number of hard
link, File
permissions, File size, File access and modification time and so on of a given file
using stat()
system call.
Ans :-
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <time.h>
void print_file_properties(const char *filename) {
struct stat file_stat;
// Inode number
printf("Inode number: %ld\n", (long)file_stat.st_ino);
print_file_properties(argv[1]);
return EXIT_SUCCESS;
}
Q.2] Write a C program that catches the ctrl-c (SIGINT) signal for the first time
and display the
appropriate message and exits on pressing ctrl-c again.
Ans :-
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
if (ctrl_c_count == 1) {
printf("SIGINT received! Press Ctrl+C again to exit.\n");
} else if (ctrl_c_count == 2) {
printf("SIGINT received again! Exiting program.\n");
exit(0); // Exit the program on the second SIGINT
}
}
int main() {
// Register the signal handler for SIGINT (Ctrl+C)
if (signal(SIGINT, sigint_handler) == SIG_ERR) {
perror("Error in setting signal handler");
return 1;
}
return 0;
}
Slip-3.
Q.1] Print the type of file and inode number where file name accepted through
Command Line
Ans :-
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
return 0;
}
Q.2] Write a C program which creates a child process to run linux/ unix command or
any user defined
program. The parent process set the signal handler for death of child signal and
Alarm signal. If
a child process does not complete its execution in 5 second then parent process
kills child process.
Ans :-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <string.h>
if (pid < 0) {
perror("Fork failed");
return 1;
}
return 0;
}
Slip-4
Q.1] ) Write a C program to find whether a given files passed through command line
arguments are
present in current directory or not.
Ans :-
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <string.h>
closedir(dir);
return 0; // File not found
}
return 0;
}
Q.2]Write a C program which creates a child process and child process catches a
signal SIGHUP,
SIGINT and SIGQUIT. The Parent process send a SIGHUP or SIGINT signal after every 3
seconds, at the end of 15 second parent send SIGQUIT signal to child and child
terminates by
displaying message "My Papa has Killed me!!!”.
Ans :-
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <string.h>
closedir(dir);
return 0; // File not found
}
return 0;
}
Slip 5
Q1] Read the current directory and display the name of the files, no of files in
current directory
Ans :-
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
int main() {
struct dirent *entry;
DIR *dir = opendir("."); // Open current directory
if (dir == NULL) {
perror("opendir");
exit(1);
}
int file_count = 0;
return 0;
}
Q.2] Write a C program to create an unnamed pipe. The child process will write
following three
messages to pipe and parent process display it.
Message1 = “Hello World”
Message2 = “Hello SPPU”
Message3 = “Linux is Funny”
Ans -
#include <stdio.h>
#include <unistd.h>
#include <string.h>
int main() {
int pipefds[2]; // Array to store pipe file descriptors
pid_t child_pid;
char writemessages[3][20] = {"Hello World", "Hello SPPU", "Linux is Funny"};
char readmessage[20];
return 0;
}
Silp 6
Q.1] Display all the files from current directory which are created in particular
month
Ans :-
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <sys/stat.h>
#include <time.h>
#include <string.h>
// Ask the user for the month name (e.g., "Jan", "Feb", etc.)
printf("Enter the month name (e.g., Jan, Feb, etc.): ");
scanf("%s", month_name);
return 0;
}
int main() {
int n, i;
pid_t pid;
struct tms start_time, end_time;
clock_t start_clock, end_clock;
if (pid < 0) {
perror("Fork failed");
exit(EXIT_FAILURE);
}
else if (pid == 0) {
// Child process: do some work
// Simulate some work by the child process (for example, a short sleep)
sleep(1); // Simulate child process doing work (replace with actual
work)
exit(0); // Child exits after completing work
}
}
return 0;
}
Slip 7
int main() {
FILE *file;
// You can still use the regular printf function, but it will write to the file
fclose(file); // Close the file when done
return 0;
}
Q.2] Implement the following unix/linux command (use fork, pipe and exec system
call)
ls –l | wc –l
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
int main() {
int pipefd[2];
pid_t pid1, pid2;
// Create a pipe
if (pipe(pipefd) == -1) {
perror("pipe");
exit(EXIT_FAILURE);
}
// Parent process
// Close both ends of the pipe as the parent doesn't need them
close(pipefd[0]);
close(pipefd[1]);
return 0;
}
slip 8
Q.1] Write a C program that redirects standard output to a file output.txt. (use of
dup and open system
call).
Ans -
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
int main() {
// Open the output file in write mode, create it if it doesn't exist
int file_desc = open("output.txt", O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR |
S_IWUSR);
if (file_desc == -1) {
perror("open");
exit(EXIT_FAILURE);
}
return 0;
}
Q.2] Implement the following unix/linux command (use fork, pipe and exec system
call)
ls –l | wc –l.
Ans -
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
int main() {
int pipefd[2];
pid_t pid1, pid2;
return 0;
}
slip 9
Q.1] Generate parent process to write unnamed pipe and will read from it
Ans -
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
int main() {
int pipefds[2];
pid_t pid;
char write_message[] = "Hello from Parent!";
char read_message[100];
return 0;
}
identify_file_type(argv[1]);
return 0;
}
slip 10
Q.1] Write a program that illustrates how to execute two commands concurrently with
a pipe.
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
int main() {
int pipefd[2]; // Pipe file descriptors
pid_t pid1, pid2;
// Create a pipe
if (pipe(pipefd) == -1) {
perror("pipe");
exit(EXIT_FAILURE);
}
// Parent process
close(pipefd[0]); // Close both ends of the pipe in the parent
close(pipefd[1]);
return 0;
}
Q.2] ) Generate parent process to write unnamed pipe and will write into it. Also
generate child process
which will read from pipe
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main() {
int pipefd[2]; // File descriptors for the pipe
pid_t pid; // Process ID for fork
return 0;
}
slip 11
Q.1] Write a C program to get and set the resource limits such as files, memory
associated with a
process
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <sys/resource.h>
void print_resource_limits() {
struct rlimit rlim;
// Get the current resource limit for the maximum number of open files
if (getrlimit(RLIMIT_NOFILE, &rlim) == 0) {
printf("Current maximum number of open files: %lu\n", (unsigned
long)rlim.rlim_cur);
printf("Maximum allowed number of open files: %lu\n", (unsigned
long)rlim.rlim_max);
} else {
perror("getrlimit");
}
// Get the current resource limit for maximum memory (in bytes)
if (getrlimit(RLIMIT_AS, &rlim) == 0) {
printf("Current maximum memory limit: %lu bytes\n", (unsigned
long)rlim.rlim_cur);
printf("Maximum allowed memory limit: %lu bytes\n", (unsigned
long)rlim.rlim_max);
} else {
perror("getrlimit");
}
}
int main() {
printf("Before setting resource limits:\n");
print_resource_limits();
return 0;
}
Q.2] Write a C program that redirects standard output to a file output.txt. (use of
dup and open system
call).
Ans -
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
int main() {
int file_descriptor;
// Open (or create) the output.txt file with write-only permissions and create
if doesn't exist
file_descriptor = open("output.txt", O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR |
S_IWUSR);
if (file_descriptor == -1) {
perror("Error opening/creating file");
return 1;
}
return 0;
}
slip 12
Q.1] Write a C program that print the exit status of a terminated child process
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
int main(void) {
pid_t pid = fork(); // Create a child process
if (pid < 0) {
// Error in creating child process
perror("fork failed");
exit(EXIT_FAILURE);
}
if (pid == 0) {
// Child process
printf("Child process is running...\n");
// Simulate some work, then exit with a status
exit(42); // Exit with a custom status
} else {
// Parent process
int status;
return 0;
}
int main(void) {
pid_t pid = fork(); // Create a child process
if (pid < 0) {
// Error in creating child process
perror("fork failed");
exit(EXIT_FAILURE);
}
if (pid == 0) {
// Child process
printf("Child process is running...\n");
// Simulate some work, then exit with a status
exit(42); // Exit with a custom status
} else {
// Parent process
int status;
return 0;
}
Q.2]Write a C program which receives file names as command line arguments and
display those
filenames in ascending order according to their sizes. I) (e.g $ a.out a.txt b.txt
c.txt, …)
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <string.h>
typedef struct {
char *filename;
off_t filesize;
} FileInfo;
free(files);
return 0;
}
slip 13
void child_process() {
printf("Child process started (PID: %d)\n", getpid());
int main() {
pid_t pid = fork();
if (pid < 0) {
perror("Fork failed");
exit(1);
}
if (pid == 0) {
// In child process
child_process();
} else {
// In parent process
printf("Parent process (PID: %d) will suspend child process\n", getpid());
sleep(3); // Let the child run for 3 seconds
// Wait for the child process to finish (will not finish unless manually
killed)
wait(NULL);
}
return 0;
}
Q.2]Write a C program that a string as an argument and return all the files that
begins with that name
in the current directory. For example > ./a.out foo will return all file names that
begins with foo
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
closedir(dp);
return 0;
}
slip 14
Q.1] Display all the files from current directory whose size is greater that n
Bytes Where n is accept
from user.
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <sys/stat.h>
int main() {
DIR *dir;
struct dirent *entry;
struct stat file_stat;
long size_limit;
// Check if it's a regular file and its size is greater than the limit
if (S_ISREG(file_stat.st_mode) && file_stat.st_size > size_limit) {
printf("%s - %ld bytes\n", entry->d_name, file_stat.st_size);
}
}
closedir(dir);
return 0;
}
Q.2] Write a C program to find file properties such as inode number, number of hard
link, File
permissions, File size, File access and modification time and so on of a given file
using stat()
system call.
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <sys/stat.h>
int main() {
DIR *dir;
struct dirent *entry;
struct stat file_stat;
long size_limit;
// Check if it's a regular file and its size is greater than the limit
if (S_ISREG(file_stat.st_mode) && file_stat.st_size > size_limit) {
printf("%s - %ld bytes\n", entry->d_name, file_stat.st_size);
}
}
closedir(dir);
return 0;
}
slip15
Q.1]Display all the files from current directory whose size is greater that n Bytes
Where n is accept
from user
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <sys/stat.h>
#include <string.h>
// Check if the file is a regular file and if its size is greater than n
bytes
if (S_ISREG(file_stat.st_mode) && file_stat.st_size > size_limit) {
printf("File: %s, Size: %ld bytes\n", entry->d_name,
file_stat.st_size);
}
}
int main() {
off_t size_limit;
return 0;
}
Q.2] Write a C program which creates a child process to run linux/ unix command or
any user defined
program. The parent process set the signal handler for death of child signal and
Alarm signal. If
a child process does not complete its execution in 5 second then parent process
kills child process
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <string.h>
pid_t child_pid;
int main() {
// Set up signal handlers
signal(SIGCHLD, handle_child_termination); // Handle child termination
signal(SIGALRM, handle_alarm); // Handle alarm signal
if (child_pid < 0) {
perror("Fork failed");
exit(1);
}
if (child_pid == 0) {
// In child process
printf("Child process started. Running a command...\n");
return 0;
}
slip 16
Q.1] Read the current directory and display the name of the files, no of files in
current directory
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
int main() {
DIR *dir;
struct dirent *entry;
int file_count = 0;
// Read each entry in the directory and print the file names
printf("Files in current directory:\n");
while ((entry = readdir(dir)) != NULL) {
// Skip the special entries "." and ".."
if (entry->d_name[0] != '.') {
printf("%s\n", entry->d_name);
file_count++;
}
}
return 0;
}
Q.2] Write a C program to implement the following unix/linux command (use fork,
pipe and exec
system call). Your program should block the signal Ctrl-C and Ctrl-\ signal during
the execution.
i. Ls –l | wc –l
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>
void block_signals() {
// Block SIGINT (Ctrl-C) and SIGQUIT (Ctrl-\)
sigset_t set;
sigemptyset(&set);
sigaddset(&set, SIGINT);
sigaddset(&set, SIGQUIT);
sigprocmask(SIG_BLOCK, &set, NULL);
}
int main() {
int pipefds[2];
pid_t pid1, pid2;
// If execlp fails
perror("execlp ls");
exit(1);
}
// If execlp fails
perror("execlp wc");
exit(1);
}
// Parent process
close(pipefds[0]); // Close both ends of the pipe in the parent process
close(pipefds[1]);
return 0;
}
Slip 17
return 0;
}
Q.2] Write a C program to create an unnamed pipe. The child process will write
following three
messages to pipe and parent process display it.
Message1 = “Hello World”
Message2 = “Hello SPPU”
Message3 = “Linux is Funny”
Ans -
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
int main() {
int pipefds[2];
pid_t pid;
char writemessages[3][20] = {"Hello World", "Hello SPPU", "Linux is Funny"};
char readmessage[20];
if (pid == -1) {
perror("fork");
exit(EXIT_FAILURE);
}
if (pid == 0) {
// Child process
close(pipefds[0]); // Close the read end of the pipe
return 0;
}
Slip 18
Q.1] Take multiple files as Command Line Arguments and print their file type and
inode number
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
printf("\n");
}
return 0;
}
Q.2] Implement the following unix/linux command (use fork, pipe and exec system
call)
ls –l | wc –l
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
int main() {
int pipefd[2];
pid_t pid1, pid2;
// Create a pipe
if (pipe(pipefd) == -1) {
perror("pipe failed");
return 1;
}
// If execlp() fails
perror("execlp failed");
exit(1);
}
// If execlp() fails
perror("execlp failed");
exit(1);
}
// Parent process
// Close both ends of the pipe as the parent doesn't need them
close(pipefd[0]);
close(pipefd[1]);
return 0;
}
slip 19
Q1] Write a C program that illustrates suspending and resuming processes using
signals
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <sys/types.h>
void child_process() {
printf("Child process started. PID: %d\n", getpid());
while (1) {
printf("Child is running...\n");
sleep(2); // Simulate work by sleeping
}
}
int main() {
pid_t pid = fork(); // Create a child process
if (pid < 0) {
perror("fork failed");
exit(EXIT_FAILURE);
}
if (pid == 0) {
// Child process
child_process();
} else {
// Parent process
printf("Parent process. PID: %d\n", getpid());
// Wait for the child process to finish (it won't, because it has an
infinite loop)
wait(NULL);
}
return 0;
}
Q.2] Write a C program to Identify the type (Directory, character device, Block
device, Regular file,
FIFO or pipe, symbolic link or socket) of given file using stat() system call.
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
return 0;
}
slip 20
Q.1] Read the current directory and display the name of the files, no of files in
current directory
Ans -
#include <stdio.h>
#include <dirent.h>
#include <stdlib.h>
int main() {
DIR *dir;
struct dirent *entry;
int file_count = 0;
return 0;
}
Q.2] Write a C program which receives file names as command line arguments and
display those
filenames in ascending order according to their sizes. I) (e.g $ a.out a.txt b.txt
c.txt, …)
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
FileInfo files[MAX_FILES];
int fileCount = 0;
return 0;
}
slip 21
int main() {
// Redirect standard output to "output.txt"
FILE *file = freopen("output.txt", "w", stdout);
if (file == NULL) {
// Error handling if the file can't be opened
perror("Error opening file");
return 1;
}
Q.2] Write a C program to implement the following unix/linux command (use fork,
pipe and exec
system call). Your program should block the signal Ctrl-C and Ctrl-\ signal during
the execution.
i. ls –l | wc –l
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
void block_signals() {
// Block SIGINT (Ctrl-C) and SIGQUIT (Ctrl-\)
sigset_t set;
sigemptyset(&set);
sigaddset(&set, SIGINT);
sigaddset(&set, SIGQUIT);
sigprocmask(SIG_BLOCK, &set, NULL);
}
int main() {
int pipefd[2];
// Create a pipe
if (pipe(pipefd) == -1) {
perror("pipe failed");
return 1;
}
if (pid1 == 0) {
// Child process 1: Executes "ls -l"
close(pipefd[0]); // Close read end of the pipe
if (pid2 == 0) {
// Child process 2: Executes "wc -l"
close(pipefd[1]); // Close write end of the pipe
return 0;
}
Slip 21
Q.1] Read the current directory and display the name of the files, no of files in
current directory
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
int main() {
DIR *dir;
struct dirent *entry;
int file_count = 0;
Q.2]Write a C program which receives file names as command line arguments and
display those
filenames in ascending order according to their sizes. I) (e.g $ a.out a.txt b.txt
c.txt, …)
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <string.h>
slip 22
int main() {
// Open the file "output.txt" for writing, create it if it doesn't exist, and
truncate it if it does
int file = open("output.txt", O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (file < 0) {
perror("Failed to open file");
return 1;
}
return 0;
}
Q.2] Write a C program to implement the following unix/linux command (use fork,
pipe and exec
system call). Your program should block the signal Ctrl-C and Ctrl-\ signal during
the
execution. i. ls –l | wc –l
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
void block_signals() {
sigset_t set;
sigemptyset(&set);
sigaddset(&set, SIGINT); // Block Ctrl-C
sigaddset(&set, SIGQUIT); // Block Ctrl-\
sigprocmask(SIG_BLOCK, &set, NULL);
}
int main() {
int pipefd[2];
pid_t pid1, pid2;
// Create a pipe
if (pipe(pipefd) == -1) {
perror("pipe");
exit(EXIT_FAILURE);
}
// Parent process
close(pipefd[0]);
close(pipefd[1]);
return 0;
}
slip 23
Q.1] Write a C program to find whether a given file is present in current directory
or not
Ans -
#include <stdio.h>
#include <dirent.h>
#include <string.h>
closedir(dir);
if (found) {
printf("File '%s' is present in the current directory.\n", filename);
} else {
printf("File '%s' is not present in the current directory.\n", filename);
}
return 0;
}
Q.2] Write a C program to Identify the type (Directory, character device, Block
device, Regular file,
FIFO or pipe, symbolic link or socket) of given file using stat() system call.
Ans -
#include <stdio.h>
#include <sys/stat.h>
#include <stdlib.h>
identify_file_type(argv[1]);
return 0;
}
slip 24
Q.1] Print the type of file and inode number where file name accepted through
Command Line
Ans -
#include <stdio.h>
#include <sys/stat.h>
#include <stdlib.h>
print_file_info(argv[1]);
return 0;
}
Q.2] Write a C program which creates a child process to run linux/ unix command or
any user
defined program. The parent process set the signal handler for death of child
signal and Alarm
signal. If a child process does not complete its execution in 5 second then parent
process kills
child process
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>
#include <sys/types.h>
int main() {
// Set up signal handlers
signal(SIGCHLD, handle_sigchld);
signal(SIGALRM, handle_alarm);
child_pid = fork();
if (child_pid < 0) {
perror("fork failed");
exit(EXIT_FAILURE);
}
if (child_pid == 0) {
// Child process: Replace with any command/program to run
printf("Child process started. Executing a command...\n");
execlp("sleep", "sleep", "10", NULL); // Simulates a command taking 10
seconds
perror("execlp failed"); // If execlp fails
exit(EXIT_FAILURE);
} else {
// Parent process
alarm(5); // Set alarm for 5 seconds
printf("Parent process waiting for child...\n");
return 0;
}
slip 25
int main() {
int file_fd;
return 0;
}
Q.2] Write a C program that redirects standard output to a file output.txt. (use of
dup and open
system call).
Ans -
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
int main() {
int file_fd;
// Open the file for writing, create if it doesn't exist, and truncate if it
does
file_fd = open("output.txt", O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (file_fd < 0) {
perror("Failed to open or create output.txt");
exit(EXIT_FAILURE);
}
return 0;
}