I have written a code where in it would take in a executable file and the [lib*.so] library as my arguments and link @ Run-time.
I want to also take in the function in the (*.o) file @ run-time and link it.
But I don't know how to go about it.
EDIT 1:
The function I'm trying to link is a part of the .o file in the lib*.so library.
So I...
What calls best emulate pread/pwrite in MSVC 10?
...
I'v some questions about zombie processes
what the benefits from zombie process concept?
know that the kernel keeps (PID,termination status, resource usage information) for zombie process
what's the meaning of "resource usage information"
how zombie's PPID() = 1 and it still zombie , (init reaps Zombies because it wait() by default)
...
I'm seeing weird behavior when I run "ssh " to a Linux system. I tracked it down part way to a difference in bash when started in posix mode.
% bash --posix
% ln -s /tmp mytmp
% cd mytmp
% pwd
/home/user/mytmp
The bash man page has these items under posix mode:
--> When the cd builtin is invoked in logical mode, and the pathname con...
I am writing a C library which involves telling other computers on the subnet to send me messages. Therefore I must announce to them my IP address. This library should work on Linux, OS X and Windows. Currently I'm thinking mostly about the POSIX layer.
Given that a computer can have more than one address (for example if it has more ...
I can test this to find the behavior but that's not the point. In my answer to another question, a commenter recommended closing a monitored fd from another thread to wake up select. Another commenter couldn't find a reference to this behavior in the standard, and I can't find one either.
Can someone provide a pointer to the standard on...
In Linux, after establishing a DHCP lease, when I run the command route, the last line gives me the system's default route and NIC.
e.g.,
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use IFace
142.157.138.0 * 255.255.254.0 U 2 0 0 wlan0
link-local * ...
Hi.
Is it possible to decipher the hostname given the sockaddr_in strucure?
struct sockaddr_in {
short sin_family; // e.g. AF_INET, AF_INET6
unsigned short sin_port; // e.g. htons(3490)
struct in_addr sin_addr; // see struct in_addr, below
char sin_zero[8]; // zero this if you want ...
Hi! I'm writing a cross-platform application, and I need the total available disk space. For posix systems (Linux and Macos) I'm using statvfs. I created this C++ method:
long OSSpecificPosix::getFreeDiskSpace(const char* absoluteFilePath) {
struct statvfs buf;
if (!statvfs(absoluteFilePath, &buf)) {
unsigned long blksize, ...
I've seached such question in google and got different answers.I cann't determine whether posix aio in linux 2.6 support socket file descriptor or not.
if it support tcp socket,does the aiocb.aio_offset=0 relative to the first byte readed from the tcp socket fd?
if it doesn't,does any asynchronous io library in linux support socket fd?...
Hey all,
I just reviewed some really terrible code - code that sends messages on a serial port by creating a new thread to package and assemble the message in a new thread for every single message sent. Yes, for every message a pthread is created, bits are properly set up, then the thread terminates. I haven't a clue why anyone would do...
If I have two threads in my Cocoa app, and (let's say), I'm reading from file X on the disk with an NSData +dataWithContentsOfFile:, and another thread is concurrently updating or replacing that same file X, with, say a -writeToPath:atomically:?
I'm unfamiliar with what Cocoa's standard file read/writes modes are. Could the read operat...
Hello,
consider the following task :
1) read a target directory contents, pass each found dirent structure to some filter function and remember filtered elements somehow for the later processing
2) some time later, iterate through the filtered elements and process them (do some I/O)
The most obvious way is to save names of sub-direc...
I want to open a process from C code, and be able to read its standard output and standard error, while being able to write to its standard input.
The closest I get to achieving this is using popen(), but this does not allow you to read the standard error stream. You could add "2>&1" to the command, but this will not make it possible to...
I'm working on a problem where I need to have a way to convert a user inputted filename to a unique path name. Let's say I let the user specify a path name that points to a file that contains some data. I can then do Data* pData=Open(PathName). Now if the user specifies the same path name again, I'd like to be able to have a table of ...
Can local message-based sockets transfer messages up to the SO_SNDBUF/SO_RCVBUF limits, or where can the so-called 'fixed maximum length' be determined for a descriptor created with socket(PF_UNIX, SOCK_SEQPACKET, 0) or socket(PF_UNIX, SOCK_DGRAM, 0)?
...
Does basename strip away \n at the end of path? For example basename("/home/user/apple\n") would basename return "apple\n" or "apple" without the \n? If basename doesn't get rid of the \n does anyone have any suggestions as to a means of getting rid of the \
...
How do I obtain the system include search paths of the C preprocessor? This is for a script that parses arbitrary source files and needs to know the full pathnames of the headers they #include. Let's ignore for a moment that the user can alter this sequence of search paths with compiler flags. I'd prefer a solution that uses standard too...
I'm writing a layer between a POSIX filesystem, and Windows using Dokan, and need to convert error values of the errno kind (EINVAL, ENOENT, etc.), to the Win32 equivalents you'd receive when calling GetLastError() (such as ERROR_INVALID_PARAMETER).
Is there an existing function, library, or reference I can use to perform these conversi...
I need to log socket usage, and I wrote a LD_PRELOAD library.
The problem is when I override read() and write() than ordinary file operations are get logged too (of course).
So how can I tell ordinary file descriptors and socket descriptors apart?
...