1.\" $NetBSD: compat_sunos.8,v 1.21 2017/07/03 21:31:00 wiz Exp $ 2.\" 3.\" Copyright (c) 1984 Theo de Raadt 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND 16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE 19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25.\" SUCH DAMAGE. 26.\" 27.Dd February 3, 2001 28.Dt COMPAT_SUNOS 8 29.Os 30.Sh NAME 31.Nm compat_sunos 32.Nd setup procedure for m68k, sparc and sparc64 architectures 33.Sh DESCRIPTION 34.Nx Ns Tn /sparc64 , 35.Nx Ns Tn /sparc 36and some of the 37.Nx Ns Tn /m68k 38architectures can run 39.Tn SunOS 40executables. 41Most executables will work. 42.Pp 43The exceptions include programs that use the 44.Tn SunOS 45kvm library, 46and various system calls, 47.Fn ioctl Ns 's , 48or kernel semantics that are difficult to emulate. 49The number of reasons why a program might fail to work is (thankfully) 50longer than the number of programs that fail to run. 51.Pp 52Static executables will normally run without any extra setup. 53This procedure details the directories and files that must be 54set up to allow dynamically linked executables to work. 55.Pp 56The files you need are on your 57.Tn SunOS 58machine. 59You need to worry about the legal issues of ensuring that you 60have a right to use the required files on your machine. 61On your 62.Nx 63machine, do the following: 64.Bl -enum -offset 123 65.It 66.Li mkdir -p /emul/sunos/usr/lib /emul/sunos/usr/5lib 67.It 68.Li cp SunOS:/usr/lib/lib*.so.*.* NetBSD:/emul/sunos/usr/lib 69.It 70.Li cp SunOS:/usr/5lib/lib*.so.*.* NetBSD:/emul/sunos/usr/5lib 71.It 72.Li cp SunOS:/usr/lib/ld.so NetBSD:/emul/sunos/usr/lib/ld.so 73.It 74If you ever expect to use YP, you will want to create a link: 75.Bd -literal -compact 76ln -s /var/run/ypbind.lock /etc/ypbind.lock 77.Ed 78.El 79.Pp 80Alternatively, you can use an NFS mount to accomplish the same 81effect. 82On your 83.Nx 84machine, do the following: 85.Bl -enum -offset 123 86.It 87.Li mkdir -p /emul/sunos/usr 88.It 89.Li mount SunOS:/usr /emul/sunos/usr 90.El 91.Pp 92This will place the 93.Tn SunOS 94libraries on your 95.Nx 96machine 97in a location where the 98.Tn SunOS 99compatibility code will look for 100first, where they do not conflict with the standard libraries. 101.Sh NOTES 102When using 103.Nm 104on 105.Nx Ns Tn /sparc64 , 106the 107.Dv COMPAT_NETBSD32 108option must also be used. 109.Sh BUGS 110A list of things which fail to work in compatibility mode should 111be here. 112.Pp 113.Tn SunOS 114executables can not handle directory offset cookies > 32 bits. 115Should such an offset occur, you will see the message 116.Dq sunos_getdents: dir offset too large for emulated program . 117Currently, this can only 118happen on NFS mounted filesystems, mounted from servers that return 119offsets with information in the upper 32 bits. 120These errors should rarely happen, but can be avoided by mounting 121this filesystem with offset translation enabled. 122See the 123.Fl X 124option to 125.Xr mount_nfs 8 . 126The 127.Fl 2 128option to 129.Xr mount_nfs 8 130will also have the desired effect, but is less preferable. 131.Pp 132The 133.Nx Ns Tn /sparc64 134support is less complete than the other ports. 135