=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/kdump/ktrstruct.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- src/usr.bin/kdump/ktrstruct.c 2018/07/13 09:25:23 1.25 +++ src/usr.bin/kdump/ktrstruct.c 2018/11/05 17:05:50 1.26 @@ -1,4 +1,4 @@ -/* $OpenBSD: ktrstruct.c,v 1.25 2018/07/13 09:25:23 beck Exp $ */ +/* $OpenBSD: ktrstruct.c,v 1.26 2018/11/05 17:05:50 anton Exp $ */ /*- * Copyright (c) 1988, 1993 @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -517,6 +518,17 @@ printf("\n"); } +static void +ktrflock(const struct flock *fl) +{ + printf("struct flock { start=%lld, len=%lld, pid=%d, type=", + fl->l_start, fl->l_len, fl->l_pid); + flocktypename(fl->l_type); + printf(", whence="); + whencename(fl->l_whence); + printf(" }\n"); +} + void ktrstruct(char *buf, size_t buflen) { @@ -658,6 +670,13 @@ printf("flags="); showbufc(basecol + sizeof("flags=") - 1, (unsigned char *)data, datalen, VIS_DQ | VIS_TAB | VIS_NL); + } else if (strcmp(name, "flock") == 0) { + struct flock fl; + + if (datalen != sizeof(fl)) + goto invalid; + memcpy(&fl, data, datalen); + ktrflock(&fl); } else { printf("unknown structure %s\n", name); }