freebsd32_misc.c (315551) | freebsd32_misc.c (315553) |
---|---|
1/*- 2 * Copyright (c) 2002 Doug Rabson 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 --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002 Doug Rabson 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 --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: stable/11/sys/compat/freebsd32/freebsd32_misc.c 315551 2017-03-19 14:40:01Z trasz $"); | 28__FBSDID("$FreeBSD: stable/11/sys/compat/freebsd32/freebsd32_misc.c 315553 2017-03-19 14:46:40Z trasz $"); |
29 30#include "opt_compat.h" 31#include "opt_inet.h" 32#include "opt_inet6.h" 33 34#define __ELF_WORD_SIZE 32 35 36#include <sys/param.h> --- 1400 unchanged lines hidden (view full) --- 1437 free(sp, M_STATFS); 1438 return (error); 1439} 1440#endif 1441 1442int 1443freebsd32_pread(struct thread *td, struct freebsd32_pread_args *uap) 1444{ | 29 30#include "opt_compat.h" 31#include "opt_inet.h" 32#include "opt_inet6.h" 33 34#define __ELF_WORD_SIZE 32 35 36#include <sys/param.h> --- 1400 unchanged lines hidden (view full) --- 1437 free(sp, M_STATFS); 1438 return (error); 1439} 1440#endif 1441 1442int 1443freebsd32_pread(struct thread *td, struct freebsd32_pread_args *uap) 1444{ |
1445 struct pread_args ap; | |
1446 | 1445 |
1447 ap.fd = uap->fd; 1448 ap.buf = uap->buf; 1449 ap.nbyte = uap->nbyte; 1450 ap.offset = PAIR32TO64(off_t,uap->offset); 1451 return (sys_pread(td, &ap)); | 1446 return (kern_pread(td, uap->fd, uap->buf, uap->nbyte, 1447 PAIR32TO64(off_t, uap->offset))); |
1452} 1453 1454int 1455freebsd32_pwrite(struct thread *td, struct freebsd32_pwrite_args *uap) 1456{ | 1448} 1449 1450int 1451freebsd32_pwrite(struct thread *td, struct freebsd32_pwrite_args *uap) 1452{ |
1457 struct pwrite_args ap; | |
1458 | 1453 |
1459 ap.fd = uap->fd; 1460 ap.buf = uap->buf; 1461 ap.nbyte = uap->nbyte; 1462 ap.offset = PAIR32TO64(off_t,uap->offset); 1463 return (sys_pwrite(td, &ap)); | 1454 return (kern_pwrite(td, uap->fd, uap->buf, uap->nbyte, 1455 PAIR32TO64(off_t, uap->offset))); |
1464} 1465 1466#ifdef COMPAT_43 1467int 1468ofreebsd32_lseek(struct thread *td, struct ofreebsd32_lseek_args *uap) 1469{ 1470 1471 return (kern_lseek(td, uap->fd, uap->offset, uap->whence)); --- 72 unchanged lines hidden (view full) --- 1544 return (error); 1545} 1546 1547#ifdef COMPAT_FREEBSD6 1548/* versions with the 'int pad' argument */ 1549int 1550freebsd6_freebsd32_pread(struct thread *td, struct freebsd6_freebsd32_pread_args *uap) 1551{ | 1456} 1457 1458#ifdef COMPAT_43 1459int 1460ofreebsd32_lseek(struct thread *td, struct ofreebsd32_lseek_args *uap) 1461{ 1462 1463 return (kern_lseek(td, uap->fd, uap->offset, uap->whence)); --- 72 unchanged lines hidden (view full) --- 1536 return (error); 1537} 1538 1539#ifdef COMPAT_FREEBSD6 1540/* versions with the 'int pad' argument */ 1541int 1542freebsd6_freebsd32_pread(struct thread *td, struct freebsd6_freebsd32_pread_args *uap) 1543{ |
1552 struct pread_args ap; | |
1553 | 1544 |
1554 ap.fd = uap->fd; 1555 ap.buf = uap->buf; 1556 ap.nbyte = uap->nbyte; 1557 ap.offset = PAIR32TO64(off_t,uap->offset); 1558 return (sys_pread(td, &ap)); | 1545 return (kern_pread(td, uap->fd, uap->buf, uap->nbyte, 1546 PAIR32TO64(off_t, uap->offset))); |
1559} 1560 1561int 1562freebsd6_freebsd32_pwrite(struct thread *td, struct freebsd6_freebsd32_pwrite_args *uap) 1563{ | 1547} 1548 1549int 1550freebsd6_freebsd32_pwrite(struct thread *td, struct freebsd6_freebsd32_pwrite_args *uap) 1551{ |
1564 struct pwrite_args ap; | |
1565 | 1552 |
1566 ap.fd = uap->fd; 1567 ap.buf = uap->buf; 1568 ap.nbyte = uap->nbyte; 1569 ap.offset = PAIR32TO64(off_t,uap->offset); 1570 return (sys_pwrite(td, &ap)); | 1553 return (kern_pwrite(td, uap->fd, uap->buf, uap->nbyte, 1554 PAIR32TO64(off_t, uap->offset))); |
1571} 1572 1573int 1574freebsd6_freebsd32_lseek(struct thread *td, struct freebsd6_freebsd32_lseek_args *uap) 1575{ 1576 int error; 1577 off_t pos; 1578 --- 1564 unchanged lines hidden --- | 1555} 1556 1557int 1558freebsd6_freebsd32_lseek(struct thread *td, struct freebsd6_freebsd32_lseek_args *uap) 1559{ 1560 int error; 1561 off_t pos; 1562 --- 1564 unchanged lines hidden --- |