Skip to content
Advertisement

Tag: c++

Linux, scanf in loop, while stdin already loaded

I have trouble with scanf and a loop on linux. If in the shell Linux, if I execute my file like this : Then the result will be this : Here : lol Here : lol Here : lol Here : lol Here : lol Here : lol Here : lol Here : lol Here : lol Here : lol

C – program is terminated (fork() and exec())

I have the following code: The idea is to call with program with 1 command line argument which is a name of another compiled C program in the same folder. I want to execute that program from within the C code (hence the use of fork()), and at the same time i want to launch another program from within the

Checking if errno != EINTR: what does it mean?

I’ve found this piece of code used several times (also a similar one where it’s used open() instead of write()). Why it is checked if && errno != EINTR here ? Looking for errno on man I found the following text about EINTR, but even if I visited man 7 signal that doesn’t enlighten me. EINTR Interrupted function call (POSIX.1);

Debugging a linux daemon process written in C

On occasion a daemon I wrote in C gets these error messages: My question is how can I examine that address in libc-2.19.so to see which function is being called when the error occurs? I tried using gdb but I get : Answer With the data you provide there’s very little that can be done here to make a diagnose

How one can safely serialize std::basic_istream::pos_type?

In one of my projects I have to cache positional information about certain data chunks found in large files. I’ve already implemented a small API built around std::basic_istream<char>::pos_type placed in maps. Now I need to serialize these descriptors into a bytestream and write them on a disk for further usage (on other *nix-machines as well). I have read that this

Making Directory in C Program [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago. Improve this question For my assignment, I’ve to write a function to create a directory but I’m not allowed to use SYS functions at all! Is there any

Advertisement