pwd()
{
char path[MAXPATHLEN + 1];
+#if 0/*ndef HAVE_GETCWD*/ /* XXX enable when autoconf happens */
extern char *getwd();
- if (getwd(path) == (char *)NULL)
+#define getcwd(x,y) getwd(x)
+#endif
+ if (getcwd(path, MAXPATHLEN+1) == (char *)NULL)
reply(550, "%s.", path);
else
reply(257, "\"%s\" is current directory.", path);
afs_int32 errorcode, groups[NGROUPS_MAX], errornumber, ins= data->in_size;
rmtbulk InData, OutData;
char pathname[256], *pathp = pathname, *inbuffer;
+#if 0/*ndef HAVE_GETCWD*/ /* XXX enable when autoconf happens */
extern char *getwd();
+#define getcwd(x,y) getwd(x)
+#endif
if (!(conn = rx_connection(&errorcode, "pioctl"))) {
/* Remote call can't be performed for some reason.
* Try the local 'pioctl' system call ... */
if (path) {
if (*path != '/') {
/* assuming relative path name */
- if (getwd(pathname) == NULL) {
+ if (getcwd(pathname, 256) == NULL) {
free(inbuffer);
printf("getwd failed; exiting\n");
exit(1);
struct timeval tvp[2];
int fd1;
int code;
+#ifndef HAVE_GETCWD
+ extern char *getwd();
+#define getcwd(x,y) getwd(x)
+#endif
/* venus system tester */
if (argc != 2) return printf("usage: fulltest <dir-to-screw-up>\n");
dirName = argv[1];
mkdir(dirName, 0777);
if (chdir(dirName) < 0) return perror("chdir");
- if (getwd(tempName) == 0) {
+ if (getcwd(tempName, 1024) == 0) {
return printf("Could not get working dir.\n");
}
/* now create some files */
char fname[MAXNAMELEN], name[MAXNAMELEN], lname[MAXNAMELEN], mname[MAXNAMELEN];
char thisdir[MAXPATHLEN], *t;
struct DumpHeader dh; /* Defined in dump.h */
+#if 0/*ndef HAVE_GETCWD*/ /* XXX enable when autoconf happens */
+ extern char *getwd();
+#define getcwd(x,y) getwd(x)
+#endif
if (as->parms[0].items) { /* -file <dumpfile> */
dumpfile = fopen(as->parms[0].items->data, "r");
* or -dir or the current working dir.
*/
if ((as->parms[3].items) || (as->parms[1].items)) { /* -mountpoint or -dir*/
- t = (char *)getwd(thisdir); /* remember current dir */
+ t = (char *)getcwd(thisdir, MAXPATHLEN); /* remember current dir */
if (!t) {
fprintf(stderr, "Cannot get pathname of current working directory: %s\n",
thisdir);
fprintf(stderr, "Mount point directory not found: Error = %d\n", stderr);
goto cleanup;
}
- t = (char *)getwd(mntroot); /* get its full pathname */
+ t = (char *)getcwd(mntroot, MAXPATHLEN); /* get its full pathname */
if (!t) {
fprintf(stderr, "Cannot determine pathname of mount point root directory: %s\n",
mntroot);
goto cleanup;
}
} else { /* use current directory */
- t = (char *)getwd(mntroot); /* get full pathname of current dir */
+ t = (char *)getcwd(mntroot, MAXPATHLEN); /* get full pathname of current dir */
if (!t) {
fprintf(stderr, "Cannot determine pathname of current working directory: %s\n",
mntroot);