1995-08-09 08:06:35 -07:00
|
|
|
/***********************************************************************/
|
|
|
|
/* */
|
1996-04-30 07:53:58 -07:00
|
|
|
/* Objective Caml */
|
1995-08-09 08:06:35 -07:00
|
|
|
/* */
|
|
|
|
/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
|
|
|
|
/* */
|
1996-04-30 07:53:58 -07:00
|
|
|
/* Copyright 1996 Institut National de Recherche en Informatique et */
|
1995-08-09 08:06:35 -07:00
|
|
|
/* 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];
|
1996-03-24 08:20:50 -08:00
|
|
|
if (getwd(buff) == 0) uerror("getcwd", copy_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
|