This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <queue> | |
#include <vector> | |
#include <iostream> | |
using namespace std; | |
vector<int> mat[3001]; | |
int check[3001]; | |
int dist[3001]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int stream_send(int sock, void *buf, size_t buflen, int flag) | |
{ | |
int written = 0; | |
int ret; | |
while (written < buflen) { | |
ret = send(sock, (char *)buf + written, | |
buflen - written, flag); | |
if (ret == -1) { | |
return ret; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/un.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
static void print_usage(char *progname) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int d[1001][1001]; | |
int main(void) { | |
ios_base::sync_with_stdio(false); | |
cin.tie(nullptr); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
void test_func(void) { | |
printf("It's test function(%d)\n", getpid()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
int main(int argc, char **argv) | |
{ | |
pid_t pid; | |
pid = fork(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/wait.h> | |
#include <sys/types.h> | |
int main(int argc, char **argv) | |
{ | |
int status; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if 0 | |
SYNOPSIS | |
#include <unistd.h> | |
unsigned int alarm(unsigned int seconds); | |
DESCRIPTION | |
alarm() arranges for a SIGALRM signal to be delivered to the calling process in seconds seconds. | |
If seconds is zero, any pending alarm is canceled. | |
In any event any previously set alarm() is canceled. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/un.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#define SOCKPATH "./sockpath" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if 0 | |
SYNOPSIS | |
#include <signal.h> | |
typedef void (*sighandler_t)(int); | |
sighandler_t signal(int signum, sighandler_t handler); | |
시그널 함수는 void 반환형에 signum을 매개변수로 하는 함수로 작성하면 된다 | |
#endif |