Hi,
I am trying to figure out how libhandle is used and have run into some
difficulties.
when i use the following code:
if (path_to_handle(path, &handle, &hlen) != 0) {
perror("path_to_handle");
return 1;
}
if ((fd = open_by_handle(handle, hlen, O_RDWR)) == -1)
perror("open_by_handle");
open_by_handle returns EBADF, the docs are not clear on whether it
wants a handle or a fshandle, so i tried with a fshandle and this time
it returns ENOTDIR if i try to open a regular file, and EINVAL if i
try to open a directory.
am i missing something obvious? or does this simply not work in linux?
also when looking at the libhandle source i noticed a few cases where
it calls exit(1) rather then return 1; from functions (path_to_handle
does this if its internal open() call fails) this is really bad form
for a shared library.
--
Ethan Benson
http://www.alaska.net/~erbenson/
pgpalhlgNnjoD.pgp
Description: PGP signature
|