[Edit1:] For the seqName, I declare it as a global parameter at the beginning of the file as char seqName[20]; [Edit2:] Aren’t those number of passing to the program during the actual execution? I got the following message just by using the valgrind tool. The command I input is: jl@ubuntu:~/work/dsr_analysis$ valgrind –tool=memcheck –leak-check=yes ./test [Edit3:] Sorry, since I am a
Tag: c++
How to install the program depending on libstdc++ library
My program is written in C++, using GCC on Ubuntu 9.10 64 bit. If depends on /usr/lib64/libstdc++.so.6 which actually points to /usr/lib64/libstdc++.so.6.0.13. Now I copy this program to virgin Ubuntu 7.04 system and try to run it. It doesn’t run, as expected. Then I add to the program directory the following files: libstdc++.so.6.0.13 libstdc++.so.6 (links to libstdc++.so.6.0.13) Execute command: Now
C++ wrapper for posix and linux specific functions [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 5 years ago. Improve this question Do you know about any good library wrapping posix and linux
Get directory path by fd
I’ve run into the need to be able refer to a directory by path given its file descriptor in Linux. The path doesn’t have to be canonical, it just has to be functional so that I can pass it to other functions. So, taking the same parameters as passed to a function like fstatat(), I need to be able to
Program configuration data in Unix/Linux
What is recommended way to keep a user configuration data in Unix/Linux? My programming language is C++. Configuration data will be kept in XML/text/binary format, I have no problem with handling such files. I want to know where can I keep them. For example, in the Windows OS configuration data may be kept in the Registry (old way) or in
Error compiling BASIC “libnotify” code
Compiling the code gives me “undefined reference to” error: I took the code from this blog. Answer Sounds like you forgot to pass -lnotify to actually link against libnotify.
Get IP address of an interface on Linux
How can I get the IPv4 address of an interface on Linux from C code? For example, I’d like to get the IP address (if any) assigned to eth0. Answer Try this: The code sample is taken from here.
Get notified about network interface change on Linux
I need a way to notify my user space app when a network interface is enabled or disabled. I’m hoping to do this without resorting to polling. Does the kernel offer some sort of hook for triggering callback functions when network-related events occur? Answer I believe the netlink (man 7 netlink) facility provides information about network interfaces via the NETLINK_ROUTE
Non-blocking pipe using popen?
I’d like to open a pipe using popen() and have non-blocking ‘read’ access to it. How can I achieve this? (The examples I found were all blocking/synchronous) Answer Setup like this: Now you can read: When you’re done, cleanup:
Is errno thread-safe?
In errno.h, this variable is declared as extern int errno; so my question is, is it safe to check errno value after some calls or use perror() in multi-threaded code. Is this a thread safe variable? If not, then whats the alternative ? I am using linux with gcc on x86 architecture. Answer Yes, it is thread safe. On Linux,