Deleted Added
full compact
uipc_mqueue.c (321322) uipc_mqueue.c (341074)
1/*-
2 * Copyright (c) 2005 David Xu <davidxu@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 29 unchanged lines hidden (view full) ---

38 * times at different mount points but shows same contents.
39 *
40 * 2) Standard POSIX message queue API. The syscalls do not use vfs layer,
41 * but directly operate on internal data structure, this allows user to
42 * use the IPC facility without having to mount mqueue file system.
43 */
44
45#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2005 David Xu <davidxu@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 29 unchanged lines hidden (view full) ---

38 * times at different mount points but shows same contents.
39 *
40 * 2) Standard POSIX message queue API. The syscalls do not use vfs layer,
41 * but directly operate on internal data structure, this allows user to
42 * use the IPC facility without having to mount mqueue file system.
43 */
44
45#include <sys/cdefs.h>
46__FBSDID("$FreeBSD: stable/11/sys/kern/uipc_mqueue.c 321322 2017-07-21 06:48:47Z kib $");
46__FBSDID("$FreeBSD: stable/11/sys/kern/uipc_mqueue.c 341074 2018-11-27 16:51:18Z markj $");
47
48#include "opt_capsicum.h"
49#include "opt_compat.h"
50
51#include <sys/param.h>
52#include <sys/kernel.h>
53#include <sys/systm.h>
54#include <sys/limits.h>

--- 1361 unchanged lines hidden (view full) ---

1416 */
1417 if (pn->mn_pr_root != NULL && pn->mn_pr_root != pr_root)
1418 continue;
1419 if (!pn->mn_fileno)
1420 mqfs_fileno_alloc(mi, pn);
1421 entry.d_fileno = pn->mn_fileno;
1422 for (i = 0; i < MQFS_NAMELEN - 1 && pn->mn_name[i] != '\0'; ++i)
1423 entry.d_name[i] = pn->mn_name[i];
47
48#include "opt_capsicum.h"
49#include "opt_compat.h"
50
51#include <sys/param.h>
52#include <sys/kernel.h>
53#include <sys/systm.h>
54#include <sys/limits.h>

--- 1361 unchanged lines hidden (view full) ---

1416 */
1417 if (pn->mn_pr_root != NULL && pn->mn_pr_root != pr_root)
1418 continue;
1419 if (!pn->mn_fileno)
1420 mqfs_fileno_alloc(mi, pn);
1421 entry.d_fileno = pn->mn_fileno;
1422 for (i = 0; i < MQFS_NAMELEN - 1 && pn->mn_name[i] != '\0'; ++i)
1423 entry.d_name[i] = pn->mn_name[i];
1424 entry.d_name[i] = 0;
1425 entry.d_namlen = i;
1426 switch (pn->mn_type) {
1427 case mqfstype_root:
1428 case mqfstype_dir:
1429 case mqfstype_this:
1430 case mqfstype_parent:
1431 entry.d_type = DT_DIR;
1432 break;
1433 case mqfstype_file:
1434 entry.d_type = DT_REG;
1435 break;
1436 case mqfstype_symlink:
1437 entry.d_type = DT_LNK;
1438 break;
1439 default:
1440 panic("%s has unexpected node type: %d", pn->mn_name,
1441 pn->mn_type);
1442 }
1424 entry.d_namlen = i;
1425 switch (pn->mn_type) {
1426 case mqfstype_root:
1427 case mqfstype_dir:
1428 case mqfstype_this:
1429 case mqfstype_parent:
1430 entry.d_type = DT_DIR;
1431 break;
1432 case mqfstype_file:
1433 entry.d_type = DT_REG;
1434 break;
1435 case mqfstype_symlink:
1436 entry.d_type = DT_LNK;
1437 break;
1438 default:
1439 panic("%s has unexpected node type: %d", pn->mn_name,
1440 pn->mn_type);
1441 }
1442 dirent_terminate(&entry);
1443 if (entry.d_reclen > uio->uio_resid)
1444 break;
1445 if (offset >= uio->uio_offset) {
1446 error = vfs_read_dirent(ap, &entry, offset);
1447 if (error)
1448 break;
1449 }
1450 offset += entry.d_reclen;

--- 1470 unchanged lines hidden ---
1443 if (entry.d_reclen > uio->uio_resid)
1444 break;
1445 if (offset >= uio->uio_offset) {
1446 error = vfs_read_dirent(ap, &entry, offset);
1447 if (error)
1448 break;
1449 }
1450 offset += entry.d_reclen;

--- 1470 unchanged lines hidden ---