Skip to content

Instantly share code, notes, and snippets.

@udaya1223
udaya1223 / waitforchild.c
Last active August 29, 2015 13:59
How to use wait() and waitpid() for handling the child processes using SIGCHLD.
#include<stdio.h>
#include<stdlib.h>
#include<signal.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <string.h>
#define DELAY 5
int counter = 0;
@udaya1223
udaya1223 / response.c
Created April 9, 2014 04:03
Measure user response time using getch() funtion.
#include <termios.h>
#include <stdio.h>
#include<time.h>
#include<stdlib.h>
static struct termios old, new;
/* Initialize new terminal i/o settings */
void initTermios(int echo)
{
@udaya1223
udaya1223 / mvc.c
Last active August 29, 2015 13:57
Write unix mv function in C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <dirent.h>
int main(int ac, char *av[]){
errno = 0;
int result = 0;