Deleted Added
full compact
uipc_shm.c (297976) uipc_shm.c (298649)
1/*-
2 * Copyright (c) 2006, 2011 Robert N. M. Watson
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

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

37 *
38 * (2) Add support for this file type to fstat(1).
39 *
40 * (3) Resource limits? Does this need its own resource limits or are the
41 * existing limits in mmap(2) sufficient?
42 */
43
44#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2006, 2011 Robert N. M. Watson
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

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

37 *
38 * (2) Add support for this file type to fstat(1).
39 *
40 * (3) Resource limits? Does this need its own resource limits or are the
41 * existing limits in mmap(2) sufficient?
42 */
43
44#include <sys/cdefs.h>
45__FBSDID("$FreeBSD: head/sys/kern/uipc_shm.c 297976 2016-04-14 17:07:26Z jamie $");
45__FBSDID("$FreeBSD: head/sys/kern/uipc_shm.c 298649 2016-04-26 15:38:17Z pfg $");
46
47#include "opt_capsicum.h"
48#include "opt_ktrace.h"
49
50#include <sys/param.h>
51#include <sys/capsicum.h>
52#include <sys/conf.h>
53#include <sys/fcntl.h>

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

375
376 /*
377 * Attempt to return sanish values for fstat() on a memory file
378 * descriptor.
379 */
380 bzero(sb, sizeof(*sb));
381 sb->st_blksize = PAGE_SIZE;
382 sb->st_size = shmfd->shm_size;
46
47#include "opt_capsicum.h"
48#include "opt_ktrace.h"
49
50#include <sys/param.h>
51#include <sys/capsicum.h>
52#include <sys/conf.h>
53#include <sys/fcntl.h>

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

375
376 /*
377 * Attempt to return sanish values for fstat() on a memory file
378 * descriptor.
379 */
380 bzero(sb, sizeof(*sb));
381 sb->st_blksize = PAGE_SIZE;
382 sb->st_size = shmfd->shm_size;
383 sb->st_blocks = (sb->st_size + sb->st_blksize - 1) / sb->st_blksize;
383 sb->st_blocks = howmany(sb->st_size, sb->st_blksize);
384 mtx_lock(&shm_timestamp_lock);
385 sb->st_atim = shmfd->shm_atime;
386 sb->st_ctim = shmfd->shm_ctime;
387 sb->st_mtim = shmfd->shm_mtime;
388 sb->st_birthtim = shmfd->shm_birthtime;
389 sb->st_mode = S_IFREG | shmfd->shm_mode; /* XXX */
390 sb->st_uid = shmfd->shm_uid;
391 sb->st_gid = shmfd->shm_gid;

--- 715 unchanged lines hidden ---
384 mtx_lock(&shm_timestamp_lock);
385 sb->st_atim = shmfd->shm_atime;
386 sb->st_ctim = shmfd->shm_ctime;
387 sb->st_mtim = shmfd->shm_mtime;
388 sb->st_birthtim = shmfd->shm_birthtime;
389 sb->st_mode = S_IFREG | shmfd->shm_mode; /* XXX */
390 sb->st_uid = shmfd->shm_uid;
391 sb->st_gid = shmfd->shm_gid;

--- 715 unchanged lines hidden ---