1995-08-09 08:06:35 -07:00
|
|
|
/***********************************************************************/
|
|
|
|
/* */
|
|
|
|
/* Caml Special Light */
|
|
|
|
/* */
|
|
|
|
/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
|
|
|
|
/* */
|
|
|
|
/* Copyright 1995 Institut National de Recherche en Informatique et */
|
|
|
|
/* Automatique. Distributed only by permission. */
|
|
|
|
/* */
|
|
|
|
/***********************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
1995-05-08 08:18:32 -07:00
|
|
|
#include <mlvalues.h>
|
|
|
|
#include <alloc.h>
|
|
|
|
#include "unix.h"
|
|
|
|
|
|
|
|
#ifdef HAS_GETCWD
|
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
|
|
|
|
value unix_getcwd() /* ML */
|
|
|
|
{
|
|
|
|
char buff[MAXPATHLEN];
|
1995-11-02 06:09:42 -08:00
|
|
|
if (getcwd(buff, sizeof(buff)) == 0) uerror("getcwd", Nothing);
|
1995-05-08 08:18:32 -07:00
|
|
|
return copy_string(buff);
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
#ifdef HAS_GETWD
|
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
|
|
|
|
value unix_getcwd()
|
|
|
|
{
|
|
|
|
char buff[MAXPATHLEN];
|
1995-11-29 05:38:09 -08:00
|
|
|
if (getwd(buff) == 0) uerror("getcwd", alloc_string(buff));
|
1995-05-08 08:18:32 -07:00
|
|
|
return copy_string(buff);
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
value unix_getcwd() { invalid_argument("getcwd not implemented"); }
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|