Skip to content

Instantly share code, notes, and snippets.

@udaya1223
udaya1223 / waitforchild.c
Last active Aug 29, 2015
How to use wait() and waitpid() for handling the child processes using SIGCHLD.
View waitforchild.c
#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 Apr 9, 2014
Measure user response time using getch() funtion.
View response.c
#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 Aug 29, 2015
Write unix mv function in C
View mvc.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;