sys_pipe.c (81b895a95bdab28897bf948f5265fad1f51f8aa2) sys_pipe.c (2b68eb8e1dbbdaf6a0df1c83b26f5403ca52d4c3)
1/*-
2 * SPDX-License-Identifier: BSD-4-Clause
3 *
4 * Copyright (c) 1996 John S. Dyson
5 * Copyright (c) 2012 Giovanni Trematerra
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

1510 return (revents);
1511}
1512
1513/*
1514 * We shouldn't need locks here as we're doing a read and this should
1515 * be a natural race.
1516 */
1517static int
1/*-
2 * SPDX-License-Identifier: BSD-4-Clause
3 *
4 * Copyright (c) 1996 John S. Dyson
5 * Copyright (c) 2012 Giovanni Trematerra
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

1510 return (revents);
1511}
1512
1513/*
1514 * We shouldn't need locks here as we're doing a read and this should
1515 * be a natural race.
1516 */
1517static int
1518pipe_stat(struct file *fp, struct stat *ub, struct ucred *active_cred,
1519 struct thread *td)
1518pipe_stat(struct file *fp, struct stat *ub, struct ucred *active_cred)
1520{
1521 struct pipe *pipe;
1522#ifdef MAC
1523 int error;
1524#endif
1525
1526 pipe = fp->f_data;
1527#ifdef MAC

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

1532 if (error) {
1533 return (error);
1534 }
1535 }
1536#endif
1537
1538 /* For named pipes ask the underlying filesystem. */
1539 if (pipe->pipe_type & PIPE_TYPE_NAMED) {
1519{
1520 struct pipe *pipe;
1521#ifdef MAC
1522 int error;
1523#endif
1524
1525 pipe = fp->f_data;
1526#ifdef MAC

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

1531 if (error) {
1532 return (error);
1533 }
1534 }
1535#endif
1536
1537 /* For named pipes ask the underlying filesystem. */
1538 if (pipe->pipe_type & PIPE_TYPE_NAMED) {
1540 return (vnops.fo_stat(fp, ub, active_cred, td));
1539 return (vnops.fo_stat(fp, ub, active_cred));
1541 }
1542
1543 bzero(ub, sizeof(*ub));
1544 ub->st_mode = S_IFIFO;
1545 ub->st_blksize = PAGE_SIZE;
1546 if (pipe->pipe_pages.cnt != 0)
1547 ub->st_size = pipe->pipe_pages.cnt;
1548 else

--- 293 unchanged lines hidden ---
1540 }
1541
1542 bzero(ub, sizeof(*ub));
1543 ub->st_mode = S_IFIFO;
1544 ub->st_blksize = PAGE_SIZE;
1545 if (pipe->pipe_pages.cnt != 0)
1546 ub->st_size = pipe->pipe_pages.cnt;
1547 else

--- 293 unchanged lines hidden ---