mirror of
https://github.com/ada-dmitry/TMP_C712.git
synced 2026-09-24 09:10:16 +00:00
added py
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
static char *newargv[] = {"/usr/bin/python", NULL, NULL};
|
||||||
|
static char *newenviron[] = {NULL};
|
||||||
|
pid_t pid;
|
||||||
|
|
||||||
|
if (argc != 2)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Usage: $s <file-to-exec>\n", argv[0]);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
newargv[1] = argv[1];
|
||||||
|
|
||||||
|
if ((pid = fork()) == -1)
|
||||||
|
{
|
||||||
|
perror("fork");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pid == 0)
|
||||||
|
{
|
||||||
|
execve(newargv[0], newargv, newenviron);
|
||||||
|
perror("execve");
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("%d process started\n", pid);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
import socket
|
||||||
|
import os
|
||||||
|
|
||||||
|
socket_path = '/tmp/unix_sock.server'
|
||||||
Reference in New Issue
Block a user