1 /***********************************************************************/
5 /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
7 /* Copyright 1996 Institut National de Recherche en Informatique et */
8 /* en Automatique. All rights reserved. This file is distributed */
9 /* under the terms of the GNU Library General Public License, with */
10 /* the special exception on linking described in file ../../LICENSE. */
12 /***********************************************************************/
14 /* $Id: readlink.c 6824 2005-03-24 17:20:54Z doligez $ */
22 #include <sys/param.h>
23 #include "unixsupport.h"
27 #define PATH_MAX MAXPATHLEN
33 CAMLprim value unix_readlink(value path)
35 char buffer[PATH_MAX];
37 len = readlink(String_val(path), buffer, sizeof(buffer) - 1);
38 if (len == -1) uerror("readlink", path);
40 return copy_string(buffer);
45 CAMLprim value unix_readlink(value path)
46 { invalid_argument("readlink not implemented"); }