-#define _remdev(path) (!f_force_local && (__rmt_path=index(path, ':')))
-#define _isrmt(fd) ((fd) >= __REM_BIAS)
-
-#define rmtopen(path,oflag,mode) (_remdev(path) ? __rmt_open(path, oflag, mode, __REM_BIAS) : open(path, oflag, mode))
-#define rmtaccess(path, amode) (_remdev(path) ? 0 : access(path, amode))
-#define rmtstat(path, buf) (_remdev(path) ? (errno = EOPNOTSUPP), -1 : stat(path, buf))
-#define rmtcreat(path, mode) (_remdev(path) ? __rmt_open (path, 1 | O_CREAT, mode, __REM_BIAS) : creat(path, mode))
-#define rmtlstat(path,buf) (_remdev(path) ? (errno = EOPNOTSUPP), -1 : lstat(path,buf))
-
-#define rmtread(fd, buf, n) (_isrmt(fd) ? __rmt_read(fd - __REM_BIAS, buf, n) : read(fd, buf, n))
-#define rmtwrite(fd, buf, n) (_isrmt(fd) ? __rmt_write(fd - __REM_BIAS, buf, n) : write(fd, buf, n))
-#define rmtlseek(fd, off, wh) (_isrmt(fd) ? __rmt_lseek(fd - __REM_BIAS, off, wh) : lseek(fd, off, wh))
-#define rmtclose(fd) (_isrmt(fd) ? __rmt_close(fd - __REM_BIAS) : close(fd))
-#ifdef RMTIOCTL
-#define rmtioctl(fd,req,arg) (_isrmt(fd) ? __rmt_ioctl(fd - __REM_BIAS, req, arg) : ioctl(fd, req, arg))
-#else
-#define rmtioctl(fd,req,arg) (_isrmt(fd) ? (errno = EOPNOTSUPP), -1 : ioctl(fd, req, arg))
-#endif
-#define rmtdup(fd) (_isrmt(fd) ? (errno = EOPNOTSUPP), -1 : dup(fd))
-#define rmtfstat(fd, buf) (_isrmt(fd) ? (errno = EOPNOTSUPP), -1 : fstat(fd, buf))
-#define rmtfcntl(fd,cmd,arg) (_isrmt(fd) ? (errno = EOPNOTSUPP), -1 : fcntl (fd, cmd, arg))
-#define rmtisatty(fd) (_isrmt(fd) ? 0 : isatty(fd))
-
-#undef RMTIOCTL
-
-int __rmt_open ();
-int __rmt_close ();
-int __rmt_read ();
-int __rmt_write ();
-long __rmt_lseek ();
-int __rmt_ioctl ();
-#endif /* !NO_REMOTE */
+#define rmtstat(Path, Buffer) \
+ (_remdev (Path) ? (errno = EOPNOTSUPP), -1 : stat (Path, Buffer))
+ /* FIXME: errno should be read-only */
+
+#define rmtcreat(Path, Mode, Command) \
+ (_remdev (Path) \
+ ? rmt_open__ (Path, 1 | O_CREAT, __REM_BIAS, Command) \
+ : creat (Path, Mode))
+
+#define rmtlstat(Path, Buffer) \
+ (_remdev (Path) ? (errno = EOPNOTSUPP), -1 : lstat (Path, Buffer))
+ /* FIXME: errno should be read-only */
+
+#define rmtread(Fd, Buffer, Length) \
+ (_isrmt (Fd) ? rmt_read__ (Fd - __REM_BIAS, Buffer, Length) \
+ : read (Fd, Buffer, Length))
+
+#define rmtwrite(Fd, Buffer, Length) \
+ (_isrmt (Fd) ? rmt_write__ (Fd - __REM_BIAS, Buffer, Length) \
+ : write (Fd, Buffer, Length))
+
+#define rmtlseek(Fd, Offset, Where) \
+ (_isrmt (Fd) ? rmt_lseek__ (Fd - __REM_BIAS, Offset, Where) \
+ : lseek (Fd, Offset, Where))
+
+#define rmtclose(Fd) \
+ (_isrmt (Fd) ? rmt_close__ (Fd - __REM_BIAS) : close (Fd))
+
+#define rmtioctl(Fd, Request, Argument) \
+ (_isrmt (Fd) ? rmt_ioctl__ (Fd - __REM_BIAS, Request, Argument) \
+ : ioctl (Fd, Request, Argument))
+
+#define rmtdup(Fd) \
+ (_isrmt (Fd) ? (errno = EOPNOTSUPP), -1 : dup (Fd))
+ /* FIXME: errno should be read-only */
+
+#define rmtfstat(Fd, Buffer) \
+ (_isrmt (Fd) ? (errno = EOPNOTSUPP), -1 : fstat (Fd, Buffer))
+ /* FIXME: errno should be read-only */
+
+#define rmtfcntl(Fd, Command, Argument) \
+ (_isrmt (Fd) ? (errno = EOPNOTSUPP), -1 : fcntl (Fd, Command, Argument))
+ /* FIXME: errno should be read-only */
+
+#define rmtisatty(Fd) \
+ (_isrmt (Fd) ? 0 : isatty (Fd))