I am trying to authenticate against a HTTPS URL with “user name and password” using C-based curl API’s and curl command line arguments in linux (Fedora 14 curl 7.30.0 (i686-pc-linux-gnu) libcurl/7.30.0 OpenSSL/1.0.0 zlib/1.2.5) ) platform. When I use the URL in the Mozilla web browser it prompts for the username, password once – after I press “OK” I am able
Tag: c++
Why do C++ and strace disagree on how long the open() system call is taking?
I have a program which opens a large number of files. I am timing the execution of a C++ loop which literally just opens and closes the files using both a C++ timer and strace. Strangely the system time and the time logged by C++ (which agree with each other) are orders of magnitude larger than the time the time
Which thread handles the signal?
I have 2 threads(thread1 and thread2). And I have signal disposition for SIGINT. Whenever SIGINT occurs thread 2 should handle the signal. For that I wrote below program I compiled and and run the program. for every 1 second “thread1 active” is printing and for every 3 seconds “thread2 active” is printing. Now I generated SIGINT. But its printing “thread1
OS X UDP send error: 55 No buffer space available
While I was implementing RUDP in python3.3 on OSX10.9.1 I noticed that the following code actually does not do what it does on linux: (it doesn’t matter which language, same behavior for C, Java and C#/Mono) This code just keep writing a lot udp packets to 8.8.8.8, those packets get dropped after 4 hops so they should not reach the
Initialization of number of free pages in each order in a memory zone
I am going through the memory initialization code in linux kernel, and I can see the number of free pages for each order and migration type for the each memory zone in a memory node is set to 0. I am not able to figure out how the list is set to the proper state, as in which order has
What does “high involuntary context” switches mean?
I have re-written a part of code in C. When testing it with logging the resource usage using getrusage(2) C API. Before changing the code: After changing: I see a lot of involuntary context switches being done in the code I have re-written. My question is not about how to reduce context switches. But.. What happens when “involuntary context switches”
I do not understand how execlp() works in Linux
I have spent the last 2 days trying to understand the execlp() system call, but yet here I am. Let me get straight to the issue. The man page of execlp declares the system call as int execlp(const char *file, const char *arg, …); with the description: The const char arg and subsequent ellipses in the execl(), execlp(), and execle()
Good way to debug stack value corruption
What is a good way to debug stack value corruption. In a program of mine sometimes the address of the this pointer gets changed after a method returns that does a shutdown on a file descriptor. I debugged the program for hours but I can not find the problem. What is a good method to find out what changes the
Program output changes when piped
I have a simple C program to time process startup (I’d rather not post the full code as it’s an active school assignment). My main function looks like this: sample_time() is a function that times how long it takes to fork a new process and returns the result in seconds as a double. The part of sample_time() that forks: As
objdump -t /usr/bin/sort command shows no symbols
If I try objdump -t /usr/bin/sort command it says no symbols. But it seems to work on my programs. What is the reason for this? Answer The symbols of /usr/bin/sort has been removed, e.g. with the strip program – for most executables the symbol table is not needed (or only needed for debugging). Here is a bit more info.