diff options
author | jake <jake@FreeBSD.org> | 2002-04-06 08:13:52 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2002-04-06 08:13:52 +0000 |
commit | 3fadd16f0d529bb08a00aea06c7913ea252319c5 (patch) | |
tree | cbdce26588a43b436eeb44c64da980c5a7297309 /sys | |
parent | 855da786ec1e436a949cfa19cdbd772223db6574 (diff) | |
download | FreeBSD-src-3fadd16f0d529bb08a00aea06c7913ea252319c5.zip FreeBSD-src-3fadd16f0d529bb08a00aea06c7913ea252319c5.tar.gz |
Use CTASSERT rather than a runtime check to detect kinfo_proc size changes.
Remove the ugly yuck code to busy wait for 20 seconds.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_proc.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 3d9cb06..8a7bec2 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -85,13 +85,14 @@ struct mtx pargs_ref_lock; uma_zone_t proc_zone; uma_zone_t ithread_zone; +CTASSERT(sizeof(struct kinfo_proc) == KINFO_PROC_SIZE); + /* * Initialize global process hashing structures. */ void procinit() { - int i, j; sx_init(&allproc_lock, "allproc"); sx_init(&proctree_lock, "proctree"); @@ -104,21 +105,6 @@ procinit() proc_zone = uma_zcreate("PROC", sizeof (struct proc), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); uihashinit(); - /* - * This should really be a compile time warning, but I do - * not know of any way to do that... - */ - if (sizeof(struct kinfo_proc) != KINFO_PROC_SIZE) { - printf("This message will repeat for the next 20 seconds\n"); - for (i = 0; i < 20; i++) { - printf("WARNING: size of kinfo_proc (%ld) should be %d!!!\n", - (long)sizeof(struct kinfo_proc), KINFO_PROC_SIZE); - printf("The kinfo_proc structure was changed "); - printf("incorrectly in <sys/user.h>\n"); - for (j = 0; j < 0x7ffffff; j++); - } - - } } /* |