1*01869ca4Swiz.\" $NetBSD: compat_sunos.8,v 1.21 2017/07/03 21:31:00 wiz Exp $ 2b5930afcSjtc.\" 31a685949Sderaadt.\" Copyright (c) 1984 Theo de Raadt 41a685949Sderaadt.\" All rights reserved. 51a685949Sderaadt.\" 61a685949Sderaadt.\" Redistribution and use in source and binary forms, with or without 71a685949Sderaadt.\" modification, are permitted provided that the following conditions 81a685949Sderaadt.\" are met: 91a685949Sderaadt.\" 1. Redistributions of source code must retain the above copyright 101a685949Sderaadt.\" notice, this list of conditions and the following disclaimer. 111a685949Sderaadt.\" 2. Redistributions in binary form must reproduce the above copyright 121a685949Sderaadt.\" notice, this list of conditions and the following disclaimer in the 131a685949Sderaadt.\" documentation and/or other materials provided with the distribution. 141a685949Sderaadt.\" 151a685949Sderaadt.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND 161a685949Sderaadt.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 171a685949Sderaadt.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 181a685949Sderaadt.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE 191a685949Sderaadt.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 201a685949Sderaadt.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 211a685949Sderaadt.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 221a685949Sderaadt.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 231a685949Sderaadt.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 241a685949Sderaadt.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 251a685949Sderaadt.\" SUCH DAMAGE. 261a685949Sderaadt.\" 2749a10e62Smrg.Dd February 3, 2001 281a685949Sderaadt.Dt COMPAT_SUNOS 8 2939b11db8Sgarbled.Os 301a685949Sderaadt.Sh NAME 311009df02Smikel.Nm compat_sunos 3249a10e62Smrg.Nd setup procedure for m68k, sparc and sparc64 architectures 331a685949Sderaadt.Sh DESCRIPTION 3449a10e62Smrg.Nx Ns Tn /sparc64 , 3534a98169Sperry.Nx Ns Tn /sparc 3634a98169Sperryand some of the 3734a98169Sperry.Nx Ns Tn /m68k 3834a98169Sperryarchitectures can run 3934a98169Sperry.Tn SunOS 40ee97be87Swizexecutables. 41ee97be87SwizMost executables will work. 421a685949Sderaadt.Pp 4334a98169SperryThe exceptions include programs that use the 4434a98169Sperry.Tn SunOS 4534a98169Sperrykvm library, 467c792961Swizand various system calls, 477c792961Swiz.Fn ioctl Ns 's , 487c792961Swizor kernel semantics that are difficult to emulate. 491a685949SderaadtThe number of reasons why a program might fail to work is (thankfully) 501a685949Sderaadtlonger than the number of programs that fail to run. 511a685949Sderaadt.Pp 521a685949SderaadtStatic executables will normally run without any extra setup. 531a685949SderaadtThis procedure details the directories and files that must be 541a685949Sderaadtset up to allow dynamically linked executables to work. 551a685949Sderaadt.Pp 5634a98169SperryThe files you need are on your 5734a98169Sperry.Tn SunOS 5834a98169Sperrymachine. 591a685949SderaadtYou need to worry about the legal issues of ensuring that you 601a685949Sderaadthave a right to use the required files on your machine. 6134a98169SperryOn your 6234a98169Sperry.Nx 6334a98169Sperrymachine, do the following: 6477fe034dSjoerg.Bl -enum -offset 123 655b1fada2Spk.It 665b1fada2Spk.Li mkdir -p /emul/sunos/usr/lib /emul/sunos/usr/5lib 675b1fada2Spk.It 685b1fada2Spk.Li cp SunOS:/usr/lib/lib*.so.*.* NetBSD:/emul/sunos/usr/lib 695b1fada2Spk.It 705b1fada2Spk.Li cp SunOS:/usr/5lib/lib*.so.*.* NetBSD:/emul/sunos/usr/5lib 715b1fada2Spk.It 725b1fada2Spk.Li cp SunOS:/usr/lib/ld.so NetBSD:/emul/sunos/usr/lib/ld.so 735b1fada2Spk.It 74d022bff8SderaadtIf you ever expect to use YP, you will want to create a link: 7577fe034dSjoerg.Bd -literal -compact 7677fe034dSjoergln -s /var/run/ypbind.lock /etc/ypbind.lock 7777fe034dSjoerg.Ed 781a685949Sderaadt.El 791a685949Sderaadt.Pp 80392d5135SpkAlternatively, you can use an NFS mount to accomplish the same 81392d5135Spkeffect. 8234a98169SperryOn your 8334a98169Sperry.Nx 8434a98169Sperrymachine, do the following: 8577fe034dSjoerg.Bl -enum -offset 123 865b1fada2Spk.It 875b1fada2Spk.Li mkdir -p /emul/sunos/usr 885b1fada2Spk.It 895b1fada2Spk.Li mount SunOS:/usr /emul/sunos/usr 90392d5135Spk.El 91392d5135Spk.Pp 9234a98169SperryThis will place the 9334a98169Sperry.Tn SunOS 9434a98169Sperrylibraries on your 9534a98169Sperry.Nx 9634a98169Sperrymachine 9734a98169Sperryin a location where the 9834a98169Sperry.Tn SunOS 9934a98169Sperrycompatibility code will look for 100392d5135Spkfirst, where they do not conflict with the standard libraries. 10149a10e62Smrg.Sh NOTES 10249a10e62SmrgWhen using 10349a10e62Smrg.Nm 10449a10e62Smrgon 10549a10e62Smrg.Nx Ns Tn /sparc64 , 10649a10e62Smrgthe 1077c792961Swiz.Dv COMPAT_NETBSD32 10849a10e62Smrgoption must also be used. 1091a685949Sderaadt.Sh BUGS 1101a685949SderaadtA list of things which fail to work in compatibility mode should 1111a685949Sderaadtbe here. 1123b90a0efSfvdl.Pp 11334a98169Sperry.Tn SunOS 114*01869ca4Swizexecutables can not handle directory offset cookies > 32 bits. 1157c792961SwizShould such an offset occur, you will see the message 1167c792961Swiz.Dq sunos_getdents: dir offset too large for emulated program . 1177c792961SwizCurrently, this can only 1183b90a0efSfvdlhappen on NFS mounted filesystems, mounted from servers that return 119ee97be87Swizoffsets with information in the upper 32 bits. 120ee97be87SwizThese errors should rarely happen, but can be avoided by mounting 121ee97be87Swizthis filesystem with offset translation enabled. 122ee97be87SwizSee the 1233b90a0efSfvdl.Fl X 1243b90a0efSfvdloption to 1253b90a0efSfvdl.Xr mount_nfs 8 . 1263b90a0efSfvdlThe 1273b90a0efSfvdl.Fl 2 1283b90a0efSfvdloption to 1293b90a0efSfvdl.Xr mount_nfs 8 1303b90a0efSfvdlwill also have the desired effect, but is less preferable. 13149a10e62Smrg.Pp 13249a10e62SmrgThe 13349a10e62Smrg.Nx Ns Tn /sparc64 13449a10e62Smrgsupport is less complete than the other ports. 135