1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-23 09:10:43 +00:00

Update to keep up with the recent dev_t change in -current. No need for

a port revision bump, functionality is unchanged.
This commit is contained in:
Mike Silbersack 2004-06-24 07:52:27 +00:00
parent cf1f2dd6ae
commit e3dd2e01d6
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=112106
2 changed files with 62 additions and 13 deletions

View File

@ -55,15 +55,16 @@
#endif
};
@@ -364,24 +374,37 @@
@@ -364,28 +374,37 @@
* Based on dev/streams/streams.c
*/
static int
+#if __FreeBSD_version >= 500000
vmmon_clone(dev_t dev, int flags, void *data, struct thread *td)
+#else
#if __FreeBSD_version >= 502017
vmmon_clone(struct cdev *dev, int flags, void *data, struct thread *td)
#else
-vmmon_clone(dev_t dev, int flags, void *data, struct thread *td)
+vmmon_clone(dev_t dev, int flags, void *data, struct proc *p)
+#endif
#endif
{
int fd, error;
struct file *fp;
@ -104,12 +105,16 @@
PROC_UNLOCK(p);
vmmon_ref_count++;
@@ -415,7 +438,7 @@
@@ -415,11 +438,11 @@
*----------------------------------------------------------------------
*/
static int
#if __FreeBSD_version >= 502017
FreeBSD_Driver_Open(struct cdev *dev, int oflag, int devtype, struct thread *td)
#else
-FreeBSD_Driver_Open(dev_t dev, int oflag, int devtype, struct thread *td)
+FreeBSD_Driver_Open(dev_t dev, int oflag, int devtype, struct proc *p)
#endif
{
VMFreeBSD *vmFreeBSD;

View File

@ -1,6 +1,14 @@
--- vmmon-only/freebsd/driver.c.orig Sat Mar 13 04:04:55 2004
+++ vmmon-only/freebsd/driver.c Sat Mar 13 04:07:43 2004
@@ -163,9 +163,14 @@
--- vmmon-only/freebsd/driver.c.orig Wed Jun 23 22:11:40 2004
+++ vmmon-only/freebsd/driver.c Wed Jun 23 22:14:46 2004
@@ -50,6 +50,7 @@
#include <sys/filedesc.h>
#include <sys/fcntl.h>
#include <sys/malloc.h>
+#include <sys/module.h>
#include <sys/proc.h>
#include <sys/ioccom.h>
#include <sys/syslog.h>
@@ -163,9 +164,14 @@
static struct cdevsw vmmon_cdevsw = {
#if __FreeBSD_version >= 500104
@ -16,15 +24,51 @@
#else
/* open */ FreeBSD_Driver_Open,
/* close */ noclose,
@@ -390,6 +395,11 @@
fp->f_ops = &vmmon_fileops;
@@ -224,7 +230,11 @@
*----------------------------------------------------------------------
*/
+#if __FreeBSD_version >= 502017
+static struct cdev *vmmon_dev;
+#else
static dev_t vmmon_dev;
+#endif
static int
init_module(void)
@@ -364,7 +374,11 @@
* Based on dev/streams/streams.c
*/
static int
+#if __FreeBSD_version >= 502017
+vmmon_clone(struct cdev *dev, int flags, void *data, struct thread *td)
+#else
vmmon_clone(dev_t dev, int flags, void *data, struct thread *td)
+#endif
{
int fd, error;
struct file *fp;
@@ -391,6 +405,11 @@
fp->f_type = DTYPE_VNODE;
FILEDESC_UNLOCK(p->p_fd);
+
+#if __FreeBSD_version >= 501111
+ /* falloc now returns TWO references to the file, not one. */
+ fdrop(fp, td);
+#endif
+
PROC_LOCK(p);
td->td_dupfd = fd;
PROC_UNLOCK(p);
@@ -415,7 +434,11 @@
*----------------------------------------------------------------------
*/
static int
+#if __FreeBSD_version >= 502017
+FreeBSD_Driver_Open(struct cdev *dev, int oflag, int devtype, struct thread *td)
+#else
FreeBSD_Driver_Open(dev_t dev, int oflag, int devtype, struct thread *td)
+#endif
{
VMFreeBSD *vmFreeBSD;