summaryrefslogtreecommitdiff
path: root/ufs-utils/mkfs.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-09-08 20:03:28 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-09-08 20:03:28 +0000
commit56e5d9d850bfbf8d1c65d88b240e919ef0e86cf2 (patch)
treec1980c0c47a4734a829c62f83588b47e79768954 /ufs-utils/mkfs.c
parent75fa50496187034855255f7f0ee7920d9fc87041 (diff)
Formerly mkfs.c.~3~
Diffstat (limited to 'ufs-utils/mkfs.c')
-rw-r--r--ufs-utils/mkfs.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/ufs-utils/mkfs.c b/ufs-utils/mkfs.c
index aa747403..821d67ae 100644
--- a/ufs-utils/mkfs.c
+++ b/ufs-utils/mkfs.c
@@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)mkfs.c 8.3 (Berkeley) 2/3/94";*/
-static char *rcsid = "$Id: mkfs.c,v 1.2 1994/09/08 19:51:43 mib Exp $";
+static char *rcsid = "$Id: mkfs.c,v 1.3 1994/09/08 20:03:28 mib Exp $";
#endif /* not lint */
#include <unistd.h>
@@ -46,6 +46,30 @@ static char *rcsid = "$Id: mkfs.c,v 1.2 1994/09/08 19:51:43 mib Exp $";
#include "../ufs/fs.h"
/* #include <sys/disklabel.h> */
+/* Begin additions for GNU Hurd */
+
+/* For GNU Hurd: the ufs DIRSIZ macro is different than the BSD
+ 4.4 version that mkfs expects. So we provide here the BSD version. */
+#undef DIRSIZ
+#if (BYTE_ORDER == LITTLE_ENDIAN)
+#define DIRSIZ(oldfmt, dp) \
+ ((oldfmt) ? \
+ ((sizeof (struct direct) - (MAXNAMLEN+1)) + (((dp)->d_type+1 + 3) &~ 3)) : \
+ ((sizeof (struct direct) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3)))
+#else
+#define DIRSIZ(oldfmt, dp) \
+ ((sizeof (struct direct) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))
+#endif
+
+#define NBBY 8
+
+#define MAXPHYS (64 * 1024)
+
+/* Provide mode from struct dinode * */
+#define DI_MODE(dp) (((dp)->di_modeh << 16) | (dp)->di_model)
+
+/* End additions for GNU Hurd */
+
#ifndef STANDALONE
#include <a.out.h>
#include <stdio.h>