Operating systems, development tools, and professional services
for connected embedded systems
for connected embedded systems
![]() |
![]() |
![]() |
![]() |
pathmgr_symlink()
Create a symlink
Synopsis:
#include <sys/pathmgr.h>
int pathmgr_symlink( const char * symlink,
const char * path );
Arguments:
- symlink
- The name of the link that you want to create.
- path
- The path that you want to link to.
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The pathmgr_symlink() function creates a symbolic link, path, in the process manager that redirects to the path specified by symlink.
The pathmgr_unlink() function removes the link.
![]() |
The symbolic link isn't permanent and is lost when the system reboots. |
Returns:
- 0
- Success.
- -1
- An error occurred (errno is set).
Examples:
#include <stdio.h>
#include <sys/pathmgr.h>
int main(int argc, char **argv) {
/* Create a link /mytmp --> /dev/shmem */
if(pathmgr_symlink("/dev/shmem", "/mytmp") == -1) {
perror("Can't make link");
}
getchar();
if(pathmgr_unlink("/mytmp") == -1) {
perror("Can't unlink ");
}
return 0;
}
Classification:
| Safety: | |
|---|---|
| Cancellation point | Yes |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |
See also:
pathmgr_unlink(), symlink(), unlink()
![]() |
![]() |
![]() |
![]() |

![[Previous]](../prev.gif)
![[Contents]](../contents.gif)
![[Index]](../keyword_index.gif)
![[Next]](../next.gif)
