Deleted Added
full compact
freebsd32_misc.c (315548) freebsd32_misc.c (315550)
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 315548 2017-03-19 14:12:55Z trasz $");
28__FBSDID("$FreeBSD: stable/11/sys/compat/freebsd32/freebsd32_misc.c 315550 2017-03-19 14:36:19Z 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>

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

1462 ap.offset = PAIR32TO64(off_t,uap->offset);
1463 return (sys_pwrite(td, &ap));
1464}
1465
1466#ifdef COMPAT_43
1467int
1468ofreebsd32_lseek(struct thread *td, struct ofreebsd32_lseek_args *uap)
1469{
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>

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

1462 ap.offset = PAIR32TO64(off_t,uap->offset);
1463 return (sys_pwrite(td, &ap));
1464}
1465
1466#ifdef COMPAT_43
1467int
1468ofreebsd32_lseek(struct thread *td, struct ofreebsd32_lseek_args *uap)
1469{
1470 struct lseek_args nuap;
1471
1470
1472 nuap.fd = uap->fd;
1473 nuap.offset = uap->offset;
1474 nuap.whence = uap->whence;
1475 return (sys_lseek(td, &nuap));
1471 return (kern_lseek(td, uap->fd, uap->offset, uap->whence));
1476}
1477#endif
1478
1479int
1480freebsd32_lseek(struct thread *td, struct freebsd32_lseek_args *uap)
1481{
1482 int error;
1472}
1473#endif
1474
1475int
1476freebsd32_lseek(struct thread *td, struct freebsd32_lseek_args *uap)
1477{
1478 int error;
1483 struct lseek_args ap;
1484 off_t pos;
1485
1479 off_t pos;
1480
1486 ap.fd = uap->fd;
1487 ap.offset = PAIR32TO64(off_t,uap->offset);
1488 ap.whence = uap->whence;
1489 error = sys_lseek(td, &ap);
1481 error = kern_lseek(td, uap->fd, PAIR32TO64(off_t, uap->offset),
1482 uap->whence);
1490 /* Expand the quad return into two parts for eax and edx */
1491 pos = td->td_uretoff.tdu_off;
1492 td->td_retval[RETVAL_LO] = pos & 0xffffffff; /* %eax */
1493 td->td_retval[RETVAL_HI] = pos >> 32; /* %edx */
1494 return error;
1495}
1496
1497int

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

1578 ap.offset = PAIR32TO64(off_t,uap->offset);
1579 return (sys_pwrite(td, &ap));
1580}
1581
1582int
1583freebsd6_freebsd32_lseek(struct thread *td, struct freebsd6_freebsd32_lseek_args *uap)
1584{
1585 int error;
1483 /* Expand the quad return into two parts for eax and edx */
1484 pos = td->td_uretoff.tdu_off;
1485 td->td_retval[RETVAL_LO] = pos & 0xffffffff; /* %eax */
1486 td->td_retval[RETVAL_HI] = pos >> 32; /* %edx */
1487 return error;
1488}
1489
1490int

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

1571 ap.offset = PAIR32TO64(off_t,uap->offset);
1572 return (sys_pwrite(td, &ap));
1573}
1574
1575int
1576freebsd6_freebsd32_lseek(struct thread *td, struct freebsd6_freebsd32_lseek_args *uap)
1577{
1578 int error;
1586 struct lseek_args ap;
1587 off_t pos;
1588
1579 off_t pos;
1580
1589 ap.fd = uap->fd;
1590 ap.offset = PAIR32TO64(off_t,uap->offset);
1591 ap.whence = uap->whence;
1592 error = sys_lseek(td, &ap);
1581 error = kern_lseek(td, uap->fd, PAIR32TO64(off_t, uap->offset),
1582 uap->whence);
1593 /* Expand the quad return into two parts for eax and edx */
1594 pos = *(off_t *)(td->td_retval);
1595 td->td_retval[RETVAL_LO] = pos & 0xffffffff; /* %eax */
1596 td->td_retval[RETVAL_HI] = pos >> 32; /* %edx */
1597 return error;
1598}
1599
1600int

--- 1556 unchanged lines hidden ---
1583 /* Expand the quad return into two parts for eax and edx */
1584 pos = *(off_t *)(td->td_retval);
1585 td->td_retval[RETVAL_LO] = pos & 0xffffffff; /* %eax */
1586 td->td_retval[RETVAL_HI] = pos >> 32; /* %edx */
1587 return error;
1588}
1589
1590int

--- 1556 unchanged lines hidden ---