From 87b0db3943d6a27517809b79fc1b56f74c0d8ea4 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Sun, 15 Nov 2020 11:57:25 -0600 Subject: Add VScode stuffs --- .vscode/c_cpp_properties.json | 7 ++++--- P3/server.c | 18 +++++++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 6e3e2bc..8402ac0 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -5,10 +5,11 @@ "includePath": [ "${workspaceFolder}/P2/include" ], - "defines": [], + "defines": [ + "__USE_POSIX", + "_GNU_SOURCE" + ], "compilerPath": "/usr/bin/gcc", - "cStandard": "c11", - "cppStandard": "c++14", "intelliSenseMode": "gcc-x64" } ], diff --git a/P3/server.c b/P3/server.c index 8957d0d..87b8339 100644 --- a/P3/server.c +++ b/P3/server.c @@ -158,7 +158,9 @@ int main(int argc, char **argv) { return -1; } // Change SIGINT action for grace termination - + struct sigaction act; + sigset_t sigset; + act.sa_handler = eggs; // Open log file // Change the current working directory to server root directory @@ -166,17 +168,19 @@ int main(int argc, char **argv) { // Initialize cache (extra credit B) // Start the server - + init(port); // Create dispatcher and worker threads (all threads should be detachable) pthread_t thread; pthread_create(&thread, NULL, dispatch, NULL); // DEBUG! figure out last arg // Create dynamic pool manager thread (extra credit A) - // Terminate server gracefully - // Print the number of pending requests in the request queue - // close log file - // Remove cache (extra credit B) - return 0; } +static void eggs(int signo) { + // Terminate server gracefully + // Print the number of pending requests in the request queue + // close log file + // Remove cache (extra credit B) +} + -- cgit v1.2.3