Share

Application Heartbeat Monitor

The forum address has changed, you have been automatically redirected. Please update any bookmarks to use the new URL.

Subscribe

Don't use `mktemp'

You are viewing a single message from this topic. View all messages.

  1. 2002-07-22 18:41:05 UTC
    There might be a standard POSIX way of doing it, but on Linux I think you can do something along the lines of:

    <pseudo-code>
    pid = pid_of_program();
    fd = fd_to_get_name_of();
    char buf[1024];
    snprintf(buf, 1024, "/proc/%d/fd/%d", pid, fd);
    readlink(buf, buf, 1024);
    printf("fd %d in pid %d maps to %s\n", fd, pid, buf);
    </pseudo-code>
< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.