Module Name: src Committed By: christos Date: Wed Dec 10 00:16:05 UTC 2014
Modified Files: src/sys/sys: ioccom.h Log Message: provide a macro to symbolically print an ioctl number. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/sys/ioccom.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/sys/ioccom.h diff -u src/sys/sys/ioccom.h:1.11 src/sys/sys/ioccom.h:1.12 --- src/sys/sys/ioccom.h:1.11 Wed Oct 19 06:53:12 2011 +++ src/sys/sys/ioccom.h Tue Dec 9 19:16:05 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ioccom.h,v 1.11 2011/10/19 10:53:12 yamt Exp $ */ +/* $NetBSD: ioccom.h,v 1.12 2014/12/10 00:16:05 christos Exp $ */ /*- * Copyright (c) 1982, 1986, 1990, 1993, 1994 @@ -72,4 +72,11 @@ /* this should be _IORW, but stdio got there first */ #define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t)) +#define IOCSNPRINTF(buf, len, cmd) \ + snprintf((buf), (len), "_IO%s%s('%c', %hhu)", \ + (((cmd) >> 30) & 1) ? "W" : "", \ + (((cmd) >> 30) & 2) ? "R" : "", \ + (char)IOCGROUP(cmd), (unsigned char)(cmd)) + + #endif /* !_SYS_IOCCOM_H_ */