Build in macOS.

This commit is contained in:
Lars Brinkhoff 2016-12-03 22:29:39 +01:00
parent 2d4559f2da
commit f97498a3f0
2 changed files with 29 additions and 0 deletions

View File

@ -84,6 +84,23 @@ char *expression = 0;
char *re_comp_error; /* Error message from re_comp() */
extern char *re_comp();
#ifdef __APPLE__
static regex_t re_regexp;
char *re_comp(char *s)
{
if (regcomp(&re_regexp, s, 0) == 0)
return NULL;
else
return "error";
}
static int re_exec(char *s)
{
return regexec(&re_regexp, s, 0, 0, 0);
}
#endif
/*
read20 [-f tapefile] [-t] [-c] [-T] [-n number] pattern

View File

@ -53,6 +53,16 @@
#define MTSETBLK STSETBLK
#define MTSETDENSITY STSETDENSITY
#define mtop stop
#elif __APPLE__
#define MTWEOF 0
#define MTREW 0
#define MTFSR 0
#define MTFSF 0
#define MTBSR 0
#define MTIOCTOP 0
#define MTSETBLK 0
#define MTSETDENSITY 0
struct mtop { int mt_op; int mt_count; };
#else
#include <sys/mtio.h>
#endif
@ -280,9 +290,11 @@ tape_handle_t opentape (char *name, int create, int writable)
*p++ = '\0'; /* shoot out @, point at host name */
user = (*p != '\0') ? host : NULL; /* keep non-null user */
}
#ifndef __APPLE__
if ((mtape->tapefd = rexec (&p, htons (512), user, NULL, "/etc/rmt",
(int *) NULL)) < 0)
FAIL ("?Connection failed\n");
#endif
/* build rmt "open device" command */
if ((1 + strlen (port) + 1 + 1 + 1 + 1) > sizeof (mtape->netbuf))