mirror of
https://github.com/ioacademy-jikim/debugging
synced 2025-06-08 08:26:14 +00:00
17 lines
303 B
C
17 lines
303 B
C
#include <unistd.h>
|
|
#include <stdio.h>
|
|
#include <fcntl.h>
|
|
#include "fdleak.h"
|
|
|
|
int main (int argc, char **argv)
|
|
{
|
|
char filename[24];
|
|
|
|
CLOSE_INHERITED_FDS;
|
|
|
|
sprintf(filename, "/tmp/file.%ld", (long) getpid());
|
|
(void) DO( creat(filename, 0) );
|
|
(void) DO( unlink(filename) );
|
|
return 0;
|
|
}
|