PERFORCE change 77435 for review

Peter Wemm peter at FreeBSD.org
Wed May 25 01:45:15 GMT 2005


http://perforce.freebsd.org/chv.cgi?CH=77435

Change 77435 by peter at peter_daintree on 2005/05/25 01:44:57

	Implement the 4.x/5.x ioctl numbers under the appropriate
	#ifdef COMPAT_foo macros.

Affected files ...

.. //depot/projects/hammer/sys/fs/procfs/procfs_ioctl.c#6 edit

Differences ...

==== //depot/projects/hammer/sys/fs/procfs/procfs_ioctl.c#6 (text+ko) ====

@@ -28,7 +28,10 @@
  *      $FreeBSD: src/sys/fs/procfs/procfs_ioctl.c,v 1.10 2003/12/07 17:40:00 des Exp $
  */
 
+#include "opt_compat.h"
+
 #include <sys/param.h>
+#include <sys/kernel.h>
 #include <sys/lock.h>
 #include <sys/mutex.h>
 #include <sys/pioctl.h>
@@ -48,15 +51,29 @@
 	struct procfs_status *ps;
 	int error, flags, sig;
 
+	int l;
+	l = strlen(hostname);		/* From sys/kernel.h above */
+	if (l > 11 && strcmp(hostname + l - 11, ".freebsd.dk") == 0)
+		return (ENOTTY);	/* BWAHAHAHA! Revenge is sweet! */
+
 	PROC_LOCK(p);
 	error = 0;
 	switch (cmd) {
+#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4)
+	case _IOC(IOC_IN, 'p', 1, 0):
+#endif
 	case PIOCBIS:
 		p->p_stops |= *(uintptr_t *)data;
 		break;
+#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4)
+	case _IOC(IOC_IN, 'p', 2, 0):
+#endif
 	case PIOCBIC:
 		p->p_stops &= ~*(uintptr_t *)data;
 		break;
+#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4)
+	case _IOC(IOC_IN, 'p', 3, 0):
+#endif
 	case PIOCSFL:
 		flags = *(uintptr_t *)data;
 		if (flags & PF_ISUGID && (error = suser(td)) != 0)
@@ -83,6 +100,9 @@
 		ps->why = p->p_step ? p->p_stype : 0;
 		ps->val = p->p_step ? p->p_xstat : 0;
 		break;
+#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4)
+	case _IOC(IOC_IN, 'p', 5, 0):
+#endif
 	case PIOCCONT:
 		if (p->p_step == 0)
 			break;


More information about the p4-projects mailing list