Ed Schouten [Sat, 16 Jan 2010 17:05:27 +0000 (17:05 +0000)]
Unexpose the old uname(3) function.
Nowadays uname(3) is an inline function around __xuname(3). Prevent
linkage of new binaries against this compatibility function, similar to
what I did with ttyslot(3).
Add gmountver, disk mount verification GEOM class.
Note that due to e.g. write throttling ('wdrain'), it can stall all the disk
I/O instead of just the device it's configured for. Using it for removable
media is therefore not a good idea.
Pyun YongHyeon [Fri, 15 Jan 2010 17:55:18 +0000 (17:55 +0000)]
Don't free mbuf chains when bge(4) fails to collapse the mbuf
chains. This part of code is to enhance performance so failing the
collapsing should not free TX frames. Otherwise bge(4) will
unnecessarily drop frames which in turn can freeze the network
connection.
Reported by: Igor Sysoev (is <> rambler-co dot ru)
Tested by: Igor Sysoev (is <> rambler-co dot ru)
Attilio Rao [Fri, 15 Jan 2010 16:04:30 +0000 (16:04 +0000)]
Handling all the three clocks (hardclock, softclock, profclock) with the
LAPIC may lead to aliasing for softclock and profclock because frequencies
are sized in order to fit mainly hardclock.
atrtc used to take care of the softclock and profclock and it does still
do, if the LAPIC can't handle the clocks properly.
Revert the change when the LAPIC started taking charge of all three of
them and let atrtc handle softclock and profclock if not explicitly
requested. Such request can be made setting != 0 the new tunable
machdep.lapic_allclocks or if the new device ATPIC is not present
within the i386 kernel config (atrtc is linked to atpic presence).
Whitespace change to be able to provide the correct commit log for r202364:
---snip---
Add video clipping support but with the caveats below.
Background info:
Video clipping allows the user to provide either a series of clip rectangles
or a clip bitmap to the driver and have the driver mask the video according
to the clipping specs provided.
Adding support for clipping to the FreeBSD Linux emulator is problematic
because it seems that this feature is not supported by many drivers and
therefore it is ignored by many applications. Unfortunately, when not
using it, rather than passing in a null clipping list, some apps leave the
clipping fields uninitialized, casuing random values to be passed in. In
the case where the driver does not use the clipping info, this is not a
problem (although it is bad form). But the Linux emulator does not know
which drivers will use this and which won't, so the Linux emulator must
try to handle this clip list, and deal gracefully with cases where the
values seem to be uninitialized.
Video clipping info is passed in using the VIDIOCSWIN ioctl in two fields
in the video_window structure: the integer clipcount and the pointer clips.
How the linuxulator handles this from this commit on:
* if (clipcount == VIDEO_CLIP_BITMAP)
The clips variable is a void * pointer to a 128*625 byte
(1024*625 bit) memory area containing a bitmap of the clipping area.
The pointer in the video_window structure is copied, but no
video_clip structures are copied.
* if (clipcount > 0 && clipcount <= 16384)
The clips variable is pointer to a list of video_clip structures. Up
to clipcount structures are copied and passed to the driver.
The upper limit of 16384 was imposed here so that user code that does
not properly initialize clipcount falls through below and no attempt
is made to copy an uninitialized list. This value was found by
examining Linux drivers that support the clip list.
* else
The clipcount is either negative (but not VIDEO_CLIP_BITMAP), zero or
positive (> 16384).
All these cases are treated as invalid data. Both the clipcount field
and clips pointer are forced to zero/NULL and passed to the driver.
It should be noted that, at the time of developing this V4L emulator code,
the pwc(4) V4L driver does not support clipping.
This is v4l support for the linuxulator. This allows to access FreeBSD
native devices which support the v4l API from processes running within
the linuxulator, e.g. skype or flash can access the multimedia/pwcbsd driver.
Not tested is firmware upload, framebuffer stuff and video tuner stuff
due to lack of hardware.
The clipping part (VIDIOCSWIN) needs a little bit of further work (partly
in progress, but can not be tested due to lack of a suitable device).
The submitter tested this sucessfully with Skype and flash apps on amd64 and
i386 with the multimedia/pwcbsd driver.
Ruslan Ermilov [Fri, 15 Jan 2010 13:48:29 +0000 (13:48 +0000)]
Cherry-pick some vendor changes to mdoc and man macro packages.
(They were all made before Groff switched from GPLv2 to GPLv3,
though the mdoc macro packages is not affected by the switch.)
: 2007-11-10 Michail Vidiassov <master@iaas.msu.ru>
:
: * tmac/doc-syms (doc-str-St--susv3): New string.
: * tmac/groff_mdoc.man: Document it.
:
: 2008-09-06 Werner LEMBERG <wl@gnu.org>
:
: * tmac/doc-common (Dd, Os, Dt): Reset `doc-command-name' to make
: `.Nm' work properly if next manual page is printed.
:
: 2008-10-04 Werner LEMBERG <wl@gnu.org>
:
: * tmac/doc-common (doc-operating-system-*): Update releases.
:
: * tmac/groff_mdoc.man: Document it.
:
: 2008-10-13 Werner LEMBERG <wl@gnu.org>
:
: * tmac/groff_mdoc.man: Update documentation on BSD-like OS string
: versions.
:
: 2008-10-16 Werner LEMBERG <wl@gnu.org>
:
: * tmac/doc-common (doc-operating-system-*), tmac/groff_mdoc.man: Add
: NetBSD 4.0.1.
:
: 2008-11-05 Werner LEMBERG <wl@gnu.org>
:
: * tmac/doc-common (Dt): Start a new page if necessary and set up
: headers.
:
: 2008-12-24 Michail Vidiassov <master@iaas.msu.ru>
:
: * tmac/doc-common: Add entries for Mac OS X and FreeBSD.
:
: 2009-01-02 Werner LEMBERG <wl@gnu.org>
:
: * tmac/groff_mdoc.man: Update OS version string listing.
:
: 2009-01-03 Werner LEMBERG <wl@gnu.org>
:
: * tmac/an-old.tmac, tmac/doc.tmac: For -Tutf8, map \-, -, ', and `
: conservatively to ASCII for the sake of easy cut and paste.
Brooks Davis [Fri, 15 Jan 2010 07:18:46 +0000 (07:18 +0000)]
Only allocate the space we need before calling kern_getgroups instead
of allocating what ever the user asks for up to "ngroups_max + 1". On
systems with large values of kern.ngroups this will be more efficient.
The now redundant check that the array is large enough in
kern_getgroups() is deliberate to allow this change to be merged to
stable/8 without breaking potential third party consumers of the API.
Brooks Davis [Fri, 15 Jan 2010 07:05:00 +0000 (07:05 +0000)]
Since all other comparisons involving ngroups_max use
"ngroups_max + 1", use ">= ngroups_max+1" instead of the equivalent
"> ngroups_max" to reduce confusion.
Jilles Tjoelker [Thu, 14 Jan 2010 23:27:23 +0000 (23:27 +0000)]
In 'make delete-old', use 'exec' to redirect an fd persistently.
That is, write 'exec 3<&0' instead of '3<&0'. Due to an sh(1) bug fixed in
r199953, the latter also persisted, provided that fd 3 was not open before.
With newer sh or fd 3 open, it would not delete orphaned catpages.
Ed Schouten [Thu, 14 Jan 2010 20:58:45 +0000 (20:58 +0000)]
Add wtmpcvt(1).
This utility allows users to convert their wtmp databases to the new
format. It makes no sense for users to keep their wtmp log files if they
are unable to view them.
It basically copies ut_line into ut_id as well. This makes it possible
for last(1) and ac(8) to match login records with their corresponding
logout record.
Pyun YongHyeon [Thu, 14 Jan 2010 19:14:24 +0000 (19:14 +0000)]
Add check for fiber mode for BCM5714 PHY. This PHY supports both
copper and fiber interfaces over GMII so an explicit check is
necessary to know whether it was configured for fiber interface.
This change make BCM5715S work.
Pyun YongHyeon [Thu, 14 Jan 2010 19:08:43 +0000 (19:08 +0000)]
For controllers that has dual mode PHY(copper or fiber) interfaces
over GMII, make sure to enable GMII. With this change brgphy(4) is
used to handle the dual mode PHY. Since we still don't have a sane
way to pass PHY specific information to mii(4) layer special
handling is needed in brgphy(4) to determine which mode of PHY was
configured in parent interface.
This change make BCM5715S work.
Tested by: olli
Obtained from: OpenBSD
MFC after: 1 week
John Baldwin [Thu, 14 Jan 2010 14:43:16 +0000 (14:43 +0000)]
- Note that if_xname, if_dname, and if_dunit are usually initialized via
if_initname().
- Document if_drv_flags and replace references to IFF_(RUNNING|OACTIVE)
with references to IFF_DRV_(RUNNING|OACTIVE).
- Complete truncated sentence in the description of if_transmit by copying
from the description in if_qflush.
- Add missing line breaks for translators.
John Baldwin [Thu, 14 Jan 2010 14:36:39 +0000 (14:36 +0000)]
- Update required headers for namei() to add <sys/fcntl.h> and remove
<sys/proc.h>.
- Add RETURN VALUES and ERROR sections for namei()'s error return values.
- Add a missing link to NDHASGIANT.9.
PR: docs/142815, docs/142816
Submitted by: Lachlan Kang (1, 2)
MFC after: 3 days
Ulf Lilleengen [Thu, 14 Jan 2010 14:30:54 +0000 (14:30 +0000)]
Bring in the ext2fs work done by Aditya Sarawgi during and after Google Summer
of Code 2009:
- BSDL block and inode allocation policies for ext2fs. This involves the use
FFS1 style block and inode allocation for ext2fs. Preallocation was removed
since it was GPL'd.
- Make ext2fs MPSAFE by introducing locks to per-mount datastructures.
- Fixes for kern/122047 PR.
- Various small bugfixes.
- Move out of gnu/ directory.
Sponsored by: Google Inc.
Submitted by: Aditya Sarawgi <sarawgi.aditya AT SPAMFREE gmail DOT com>
Edwin Groothuis [Thu, 14 Jan 2010 10:56:54 +0000 (10:56 +0000)]
Make whois capable of searching for IPv6 addresses just like it can
do for IPv4 addresses without having to explicetly specify that the
ARIN server should be used to get the initial information
Ed Schouten [Thu, 14 Jan 2010 10:00:01 +0000 (10:00 +0000)]
Revert the change to Symbol.map, made in r202274.
Even though we use __sym_compat(), we should list the symbol in
Symbol.map.
ttyslot() is now listed as follows, which seems to do the right thing:
| Symbol table '.dynsym' contains 2755 entries:
| Num: Value Size Type Bind Vis Ndx Name
| 613: 00000000000477b0 121 FUNC GLOBAL DEFAULT 10 ttyslot@FBSD_1.0
Peter Pentchev [Thu, 14 Jan 2010 09:38:23 +0000 (09:38 +0000)]
Document that the IEEE80211_DEBUG kernel option is needed for
using the wlan(4) debugging controls with wording slightly
different from that in the PR.
Ed Schouten [Thu, 14 Jan 2010 05:37:43 +0000 (05:37 +0000)]
Add two changes that should have gone into commit r202274.
Phase out ttyslot(3).
The ttyslot() function was originally part for SUSv1, marked LEGACY in
SUSv2 and removed later on. This function only makes sense when using
utmp(5), because it was used to determine the offset of the record for
the controlling TTY. It makes little sense to keep it here, because the
new utmpx file format doesn't index based on TTY slots.
Ed Schouten [Thu, 14 Jan 2010 05:35:32 +0000 (05:35 +0000)]
Phase out ttyslot(3).
The ttyslot() function was originally part for SUSv1, marked LEGACY in
SUSv2 and removed later on. This function only makes sense when using
utmp(5), because it was used to determine the offset of the record for
the controlling TTY. It makes little sense to keep it here, because the
new utmpx file format doesn't index based on TTY slots.
Marcel Moolenaar [Thu, 14 Jan 2010 02:48:39 +0000 (02:48 +0000)]
Add ioctl requests to /dev/io on ia64 for reading and writing
EFI variables. The primary reason for this is that it allows
sysinstall(8) to add a boot menu item for the newly installed
FreeBSD image.
Marcel Moolenaar [Thu, 14 Jan 2010 02:14:21 +0000 (02:14 +0000)]
Add wrappers for the RT Variable Services. While here, translate the
EFI status into a standard errno value and change efi_set_time() to
return a standard error.
Ed Schouten [Wed, 13 Jan 2010 18:59:51 +0000 (18:59 +0000)]
Remove login(3), logout(3) and logwtmp(3) from libutil.
These functions only apply to utmp(5). They cannot be kept intact when
moving towards utmpx. The login(3) function would break, because its
argument is an utmp structure. The logout(3) and logwtmp(3) functions
cannot be used, since they provide a functionality which partially
overlaps.
Increment SHLIB_MAJOR to 9 to indicate the removal.
Ed Schouten [Wed, 13 Jan 2010 18:53:06 +0000 (18:53 +0000)]
Remove utmpx stub from libulog.
I'm not increasing the shlib major version for this, because not a
single application outside the base system should have used these
functions in such a short timespan.
Rewrite ulog_login(3) and ulog_logout(3) to build on top of the utmpx
implementation in libc.
Ed Schouten [Wed, 13 Jan 2010 18:43:32 +0000 (18:43 +0000)]
Make OpenSSH work with utmpx.
- Partially revert r184122 (sshd.c). Our ut_host is now big enough to
fit proper hostnames.
- Change config.h to match reality.
- defines.h requires UTMPX_FILE to be set by <utmpx.h> before it allows
the utmpx code to work. This makes no sense to me. I've already
mentioned this upstream.
- Add our own platform-specific handling of lastlog. The version I will
send to the OpenSSH folks will use proper autoconf generated
definitions instead of `#if 1'.
Ed Schouten [Wed, 13 Jan 2010 18:37:42 +0000 (18:37 +0000)]
Let telnetd build without utmp and logwtmp(3).
Just like rlogind, there is no need to change the ownership of the
terminal during shutdown anymore. Also don't call logwtmp, because the
login(1)/PAM is responsible for doing this. Also use SHUT_RDWR instead
of 2.
Ed Schouten [Wed, 13 Jan 2010 18:28:41 +0000 (18:28 +0000)]
Port ftpd to utmpx.
Unfortunately I have to partially wreck its functionality, though. ftpd
used to keep a file descriptor to the wtmp, which allowed it to work
from within a chroot. The current utmpx implementation doesn't offer a
way to do this. Maybe we can address this in the future, if it turns out
to be a real issue.
Ed Schouten [Wed, 13 Jan 2010 18:25:43 +0000 (18:25 +0000)]
Port comsat to utmpx.
It seems comsat stats the utmpx database each 15 seconds to see whether
it has been changed. I am changing this behaviour to look at the utmpx
database upon processing. I don't want to allow direct interference with
the database files. I also wonder whether this optimization has any
measurable performance benefit nowadays.
Ed Schouten [Wed, 13 Jan 2010 18:24:04 +0000 (18:24 +0000)]
Remove `dead code' from rlogind.
- It shouldn't call logwtmp(). Applications like login(1) already make
sure both login and logout entries are written to the storage.
- There's no need to restore permissions on the pseudo-terminal, since
it should be garbage collected by the kernel.
Ed Schouten [Wed, 13 Jan 2010 18:17:12 +0000 (18:17 +0000)]
Port lastlogin(8) to utmpx.
While there, fix a bug I introduced previously. We must reopen the
database for each username passed on the command line. We must rewind
the database and search from the beginning.
Ed Schouten [Wed, 13 Jan 2010 18:14:59 +0000 (18:14 +0000)]
Port ac(8) to utmpx.
Similar to last(1), it must compare ut_id's instead of TTYs to determine
whether a session has been terminated. It must also use ut_type to
determine the type of the login record instead figuring it out by
itself.
Ed Schouten [Wed, 13 Jan 2010 18:09:21 +0000 (18:09 +0000)]
Port w(1) to utmpx.
Let it print "-" when the TTY string is empty. In this case, it must
also make sure it doesn't match processes who also have no controlling
TTY. Otherwise it will print random kernel processes when trying to pick
the best matching process.
Eventually it should look at the value of ut_pid as well.
Ed Schouten [Wed, 13 Jan 2010 18:08:00 +0000 (18:08 +0000)]
Allow getent(1) to display utmpx entries as well.
Because getutxent also matches the typical get*ent format of library
routines, I thought it would be a good idea to teach it how to read
utmpx databases. getent(1) just gives a raw dump, which is very useful
when debugging problems related to parsing/logging.
Ed Schouten [Wed, 13 Jan 2010 18:06:31 +0000 (18:06 +0000)]
Port last(1) to use utmpx.
Basically there are three major things I changed about last(1):
- It should use ut_type instead of determining by hand what type of
record was given.
- It should now keep track of ut_id's instead of TTYs. This means the
ttylist has been renamed to the idlist, storing all the ut_id's it has
processed until the next reboot.
- I've removed the signal handler. Because our wtmp is rotated so often,
it makes little sense. Even on a simple piece of hardware it should be
capable of grinding through megabytes of logs in a second.
Ed Schouten [Wed, 13 Jan 2010 17:58:49 +0000 (17:58 +0000)]
Migrate init(8) towards utmpx.
According to a comment, we cannot safely remove utmpx entries here
anymore. This is because the libc routines may block on file locking. In
an ideal world login(1) should just remove the entries, which is why I'm
disabling this code for now. If it turns out we get lots of stale
entries here, we should figure out a way to deal with that.
Ed Schouten [Wed, 13 Jan 2010 17:54:32 +0000 (17:54 +0000)]
Port ppp(8) to utmpx.
A nice thing about utmpx is that it makes it very easy to log sessions
that don't use TTYs. This is because the file is not indexed by TTY
slots anymore.
Ed Schouten [Wed, 13 Jan 2010 17:50:58 +0000 (17:50 +0000)]
Migrate finger(1) towards utmpx.
It was already ported to use libulog, which makes it simpler now. Be
sure to catch the error returned by setutxdb(). Otherwise it may perform
a lookup on the utx.active database.
Ed Schouten [Wed, 13 Jan 2010 17:49:35 +0000 (17:49 +0000)]
Let csh(1) use utmpx instead of utmp.
csh allows you to monitor the utmp(x) file to monitor certain user
logins. Unfortunately it needs to directly stat() this file. I don't
want to break this module , but eventually it shouldn't do that. The
idea of the getutxent(3) API is to hide file access.
Ed Schouten [Wed, 13 Jan 2010 17:29:55 +0000 (17:29 +0000)]
Implement <utmpx.h>.
The utmpx interface is the standardized interface of the user accounting
database. The standard only defines a subset of the functions that were
present in System V-like systems.
I'd like to highlight some of the traits my implementation has:
- The standard allows the on-disk format to be different than the
in-memory representation (struct utmpx). Most operating systems don't
do this, but we do. This allows us to keep our ABI more stable, while
giving us the opportunity to modify the on-disk format. It also allows
us to use a common file format across different architectures (i.e.
byte ordering).
- Our implementation of pututxline() also updates wtmp and lastlog (now
called utx.log and utx.lastlogin). This means the databases are more
likely to be in sync.
- Care must be taken that our implementation discard any fields that are
not applicable. For example, our DEAD_PROCESS records do not hold a
TTY name. Just a time stamp, a record identifier and a process
identifier. It also guarantees that strings (ut_host, ut_line and
ut_user) are null terminated. ut_id is obviously not null terminated,
because it's not a string.
- The API and its behaviour should be conformant to POSIX, but there may
be things that slightly deviate from the standard. This implementation
uses separate file descriptors when writing to the log files. It also
doesn't use getutxid() to search for a field to overwrite. It uses an
allocation strategy similar to getutxid(), but prevents DEAD_PROCESS
records from accumulating.
Make sure libulog doesn't overwrite the manpages shipped with our C
library. Also keep the symbol list in Symbol.map sorted.
I'll bump __FreeBSD_version later this evening. I first want to convert
everything to <utmpx.h> and get rid of <utmp.h>.
David Xu [Wed, 13 Jan 2010 08:53:23 +0000 (08:53 +0000)]
Return SEM_FAILED instead of NULL, though there are same, but the
SEM_FAILED is more suitable name.
In function, sem_close(), always set errno on error.
Andrew Thompson [Wed, 13 Jan 2010 03:16:31 +0000 (03:16 +0000)]
Add a driver by Fredrik Lindberg for Option HSDPA USB devices. These differ
from standard 3G wireless units by supplying a raw IP/IPv6 endpoint rather than
using PPP over serial. uhsoctl(1) is used to initiate and close the WAN
connection.
Obtained from: Fredrik Lindberg <fli@shapeshifter.se>