Skip to content

Tag: linux

C++ + linux handle SIGPIPE signal

Yes, I understand this issue has been discussed many times. And yes, I’ve seen and read these and other discussions: 1 2 3 and I still can’t fix my code myself. I am writing my own web server. In the next cycle, it listens on a socket, connects each new client and writes it to a vector. Into my cl…

Usage of getc with a file

To print the contents of a file one can use getc: How efficient is the getc function? That is, how frequently does it actually do operating system calls or something that would take a non-trivial amount of time? For example, let’s say I had a 10TB file — would calling this function trillions of ti…

Command not found in Linux machine

I installed Fortify software in Linux using the user “Kiran”. When I typed sourceanalyzer –v using the user “Kiran” I got: But, when I searched using the user “root”, I am getting command not found. Can someone please help me on how to find the version using the root …

issues using waitpid() with large number of child process

I have a c program to create a TCP socket and keep waiting for a connection in an infinite loop. Each time a client connected to the program, I would spawn a new child process to handle the client request. My program could only exit with signal interrupt (e.g. ctrl+c). I don’t want the parent process ha…

Text-cursor position handling in C (under Linux)

I’m trying to reposition the text-cursor to top left corner of the console each frame, so the resulted square rendered at the same position I found that this is possible in windows by including <windows.h>: How can I do that in Ubuntu? Answer [update] Oops, sorry, I didn’t notice the “…

different ips in different terminal with torify

how can we get a different tor circuit with torify command in a separate terminal window? Specifically, if I type a command in a terminal 1 window I receive my IP address in response. but if I try it in another terminal window simultaneously I get the same IP which is a normal behavior. what I am trying to ac…