freebsd.git
8 years agomemmem(3): empty little string matches the beginning of the big string
emaste [Tue, 26 May 2015 21:16:07 +0000 (21:16 +0000)]
memmem(3): empty little string matches the beginning of the big string

This function originated in glibc, and this matches their behaviour
(and NetBSD, OpenBSD, and musl).

An empty big string (arg "l") is handled by the existing
l_len < s_len test.

Reviewed by: bapt, ngie
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2657

8 years agoUse SVNREVISION and BUILDDATE if passed into the make(1)
gjb [Tue, 26 May 2015 20:51:44 +0000 (20:51 +0000)]
Use SVNREVISION and BUILDDATE if passed into the make(1)
environment, fallback to trying to figure it out otherwise.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years agoPrint error message if autoload fails due to missing DTB blob, otherwise
gonzo [Tue, 26 May 2015 20:32:14 +0000 (20:32 +0000)]
Print error message if autoload fails due to missing DTB blob, otherwise
ubldr just falls back to loader prompt with no apparent reason

8 years agoImport new moduli from OpenBSD. Although there is no reason to distrust
des [Tue, 26 May 2015 19:46:41 +0000 (19:46 +0000)]
Import new moduli from OpenBSD.  Although there is no reason to distrust
the current set, it is good hygiene to change them once in a while.

MFC after: 1 week

8 years agoPrint leading zeroes of UFS2 fs_id like we do for UFS1.
ae [Tue, 26 May 2015 18:27:38 +0000 (18:27 +0000)]
Print leading zeroes of UFS2 fs_id like we do for UFS1.

PR: 156908
MFC after: 1 week

8 years agoReindent after r283575.
gjb [Tue, 26 May 2015 17:44:31 +0000 (17:44 +0000)]
Reindent after r283575.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years agoRemove duplicate exists() sanity check.
gjb [Tue, 26 May 2015 17:42:28 +0000 (17:42 +0000)]
Remove duplicate exists() sanity check.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years agoSet STAGE_TARGETS only if RELEASEDIR exists.
gjb [Tue, 26 May 2015 17:40:36 +0000 (17:40 +0000)]
Set STAGE_TARGETS only if RELEASEDIR exists.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years agoRemove a continuation on error, since the relevant behavior can
gjb [Tue, 26 May 2015 17:34:56 +0000 (17:34 +0000)]
Remove a continuation on error, since the relevant behavior can
only occur if a particular file exists.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years agoFix build WITHOUT_CDDL by unconditionnaly adding libproc and librtld_db
bapt [Tue, 26 May 2015 16:25:28 +0000 (16:25 +0000)]
Fix build WITHOUT_CDDL by unconditionnaly adding libproc and librtld_db
on supported arches to the prebuild libs

8 years agoMFi386: r283407
nyan [Tue, 26 May 2015 14:08:32 +0000 (14:08 +0000)]
MFi386: r283407
  Implement vdso - virtual dynamic shared object.

MFi386: r283474
  Rework signal code to allow using it by other modules, like linprocfs.

MFi386: r283506
  For objcopy, use --input-target and --output-target.

This fixes pc98 build.

8 years agoProvide ieee80211_get_counter() that sums up ieee802com
glebius [Tue, 26 May 2015 13:19:05 +0000 (13:19 +0000)]
Provide ieee80211_get_counter() that sums up ieee802com
errors to the errors of this vap interface.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

8 years agoAdd two counters to ieee80211com, that will be used to count transmission
glebius [Tue, 26 May 2015 12:51:14 +0000 (12:51 +0000)]
Add two counters to ieee80211com, that will be used to count transmission
or receive errors that can't be associated with any vap.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

8 years agoMake ieee80211broadcastaddr global, so that drivers or other
glebius [Tue, 26 May 2015 12:40:27 +0000 (12:40 +0000)]
Make ieee80211broadcastaddr global, so that drivers or other
code may use it and not paste.

8 years agoReduce diff before functional changes:
glebius [Tue, 26 May 2015 12:06:36 +0000 (12:06 +0000)]
Reduce diff before functional changes:
- Use ic_name instead of if_xname.
- Formatting cleanup.

8 years agoDo not allow a process to reap an orphan (a child currently being
jhb [Tue, 26 May 2015 10:29:37 +0000 (10:29 +0000)]
Do not allow a process to reap an orphan (a child currently being
traced by another process such as a debugger). The parent process does
need to check for matching orphan pids to avoid returning ECHILD if an
orphan has exited, but it should not return the exited status for the
child until after the debugger has detached from the orphan process
either explicitly or implicitly via wait().

Add two tests for for this case: one where the debugger is the direct
child (thus the parent has a non-empty children list) and one where
the debugger is not a direct child (so the only "child" of the parent
is the orphan).

Differential Revision: https://reviews.freebsd.org/D2644
Reviewed by: kib
MFC after: 2 weeks

8 years agoMigrate the scan iterator lock typedefs out into ieee80211_freebsd.h.
adrian [Tue, 26 May 2015 04:37:59 +0000 (04:37 +0000)]
Migrate the scan iterator lock typedefs out into ieee80211_freebsd.h.

This removes the final piece of freebsd-specific locking that snuck
into the tree - it's now all inside ieee80211_freebsd.h.

8 years agoMigrate the 802.11s locks out into ieee80211_freebsd.h, so they can be
adrian [Tue, 26 May 2015 04:25:11 +0000 (04:25 +0000)]
Migrate the 802.11s locks out into ieee80211_freebsd.h, so they can be
defined as platform specific bits.

This is to help make OS portability easier.

8 years agoMFuser/delphij/zfs-arc-rebase@r281754:
delphij [Tue, 26 May 2015 01:40:33 +0000 (01:40 +0000)]
MFuser/delphij/zfs-arc-rebase@r281754:

In r256613, taskqueue_enqueue_locked() have been modified to release the
task queue lock before returning.  In r276665, taskqueue_drain_all() will
call taskqueue_enqueue_locked() to insert the barrier task into the queue,
but did not reacquire the lock after it but later code expects the lock
still being held (e.g. TQ_SLEEP()).

The barrier task is special and if we release then reacquire the lock,
there would be a small race window where a high priority task could sneak
into the queue.  Looking more closely, the race seems to be tolerable but
is undesirable from semantics standpoint.

To solve this, in taskqueue_drain_tq_queue(), instead of directly calling
taskqueue_enqueue_locked(), insert the barrier task directly without
releasing the lock.

8 years agoRemove unused mutex and softc variables.
loos [Tue, 26 May 2015 01:30:09 +0000 (01:30 +0000)]
Remove unused mutex and softc variables.

8 years agoConsiders cases when NO_SHARED?=[no|NO] as dynamically linking
bapt [Tue, 26 May 2015 01:09:56 +0000 (01:09 +0000)]
Considers cases when NO_SHARED?=[no|NO] as dynamically linking

This reduces overlinking for parts of the build system where NO_SHARED is
set to no/NO

8 years agoEnsure that all arm kernel configs contain ALT_BREAK_TO_DEBUGGER and not
ian [Mon, 25 May 2015 23:27:13 +0000 (23:27 +0000)]
Ensure that all arm kernel configs contain ALT_BREAK_TO_DEBUGGER and not
BREAK_TO_DEBUGGER if they have a serial console (most do).  A burst of
serial line noise (such as unplugging a usb serial adapter) can look like
a break and drop a working system into the debugger.  The alt break sequence
(<CR>~^B) works fine on both serial and non-serial consoles.

8 years agoAdd KTR tracing for some MI ptrace events.
jhb [Mon, 25 May 2015 22:13:22 +0000 (22:13 +0000)]
Add KTR tracing for some MI ptrace events.

Differential Revision: https://reviews.freebsd.org/D2643
Reviewed by: kib

8 years agoWhen I merged the lemul branch I missied kib@'s r282708 commit.
dchagin [Mon, 25 May 2015 20:44:46 +0000 (20:44 +0000)]
When I merged the lemul branch I missied kib@'s r282708 commit.
This is not the final fix as I need properly cleanup thread resources
before other threads suicide.

Tested by: Ruslan Makhmatkhanov

8 years agontp is now again libreadline free, so only build libreadline for gdb
bapt [Mon, 25 May 2015 20:29:35 +0000 (20:29 +0000)]
ntp is now again libreadline free, so only build libreadline for gdb

8 years agoFix overlinking again after recent ntp updates
bapt [Mon, 25 May 2015 20:27:46 +0000 (20:27 +0000)]
Fix overlinking again after recent ntp updates
Fix building WITHOUT_OPENSSL

8 years agoCleanup compat shims for FreeBSD versions that predate 10.0-RELEASE.
glebius [Mon, 25 May 2015 20:06:49 +0000 (20:06 +0000)]
Cleanup compat shims for FreeBSD versions that predate 10.0-RELEASE.
There are no plans to merge anything save a trivial bugfix to stable/9.

Discussed with: adrian

8 years agoChange three methods in struct ieee80211com, namely ic_updateslot,
glebius [Mon, 25 May 2015 19:53:29 +0000 (19:53 +0000)]
Change three methods in struct ieee80211com, namely ic_updateslot,
ic_update_mcast and ic_update_promisc, to pass pointer to the ieee80211com,
not to the ifnet.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

8 years agoWhen sending RTM_IEEE80211_CSA, RTM_IEEE80211_RADAR, RTM_IEEE80211_CAC and
glebius [Mon, 25 May 2015 19:48:48 +0000 (19:48 +0000)]
When sending RTM_IEEE80211_CSA, RTM_IEEE80211_RADAR, RTM_IEEE80211_CAC and
RTM_IEEE80211_RADIO routing messages, broadcast them on all vap interfaces
instead of sending them on parent.

Reviewed by: adrian
Sponsored by: Netflix
Sponsored by: Nginx, Inc.

8 years agoConvert malloc/free back to #define's, as part of OS portability work.
adrian [Mon, 25 May 2015 19:18:16 +0000 (19:18 +0000)]
Convert malloc/free back to #define's, as part of OS portability work.

DragonflyBSD uses the FreeBSD wireless stack and drivers.  Their malloc()
API is named differently, so they don't have userland/kernel symbol
clashes like we do (think libuinet.)

So, to make it easier for them and to port to other BSDs/other operating
systems, start hiding the malloc specific bits behind defines in
ieee80211_freebsd.h.

DragonflyBSD can now put these portability defines in their local
ieee80211_dragonflybsd.h.

This should be a great big no-op for everyone running wifi.

TODO:

* kill M_WAITOK - some platforms just don't want you to use it
* .. and/or handle it returning NULL rather than waiting forever.
* MALLOC_DEFINE() ?
* Migrate the well-known malloc names (eg M_TEMP) to net80211
  namespace defines.

8 years agoSet ic_softc in all 802.11 drivers. Not required right now, but will be
glebius [Mon, 25 May 2015 18:50:26 +0000 (18:50 +0000)]
Set ic_softc in all 802.11 drivers. Not required right now, but will be
used quite soon.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

8 years agoUpdate wpi(4) to use the new mgmt RX API.
adrian [Mon, 25 May 2015 17:06:52 +0000 (17:06 +0000)]
Update wpi(4) to use the new mgmt RX API.

8 years agoBegin plumbing ieee80211_rx_stats through the receive path.
adrian [Mon, 25 May 2015 16:37:41 +0000 (16:37 +0000)]
Begin plumbing ieee80211_rx_stats through the receive path.

Smart NICs with firmware (eg wpi, iwn, the new atheros parts, the intel 7260
series, etc) support doing a lot of things in firmware.  This includes but
isn't limited to things like scanning, sending probe requests and receiving
probe responses.  However, net80211 doesn't know about any of this - it still
drives the whole scan/probe infrastructure itself.

In order to move towards suppoting smart NICs, the receive path needs to
know about the channel/details for each received packet.  In at least
the iwn and 7260 firmware (and I believe wpi, but I haven't tried it yet)
it will do the scanning, power-save and off-channel buffering for you -
all you need to do is handle receiving beacons and probe responses on
channels that aren't what you're currently on.  However the whole receive
path is peppered with ic->ic_curchan and manual scan/powersave handling.
The beacon parsing code also checks ic->ic_curchan to determine if the
received beacon is on the correct channel or not.[1]

So:

* add freq/ieee values to ieee80211_rx_stats;
* change ieee80211_parse_beacon() to accept the 'current' channel
  as an argument;
* modify the iv_input() and iv_recv_mgmt() methods to include the rx_stats;
* add a new method - ieee80211_lookup_channel_rxstats() - that looks up
  a channel based on the contents of ieee80211_rx_stats;
* if it exists, use it in the mgmt path to switch the current channel
  (which still defaults to ic->ic_curchan) over to something determined
  by rx_stats.

This is enough to kick-start scan offload support in the Intel 7260
driver that Rui/I are working on.  It also is a good start for scan
offload support for a handful of existing NICs (wpi, iwn, some USB
parts) and it'll very likely dramatically improve stability/performance
there.  It's not the whole thing - notably, we don't need to do powersave,
we should not scan all channels, and we should leave probe request sending
to the firmware and not do it ourselves.  But, this allows for continued
development on the above features whilst actually having a somewhat
working NIC.

TODO:

* Finish tidying up how the net80211 input path works.
  Right now ieee80211_input / ieee80211_input_all act as the top-level
  that everything feeds into; it should change so the MIMO input routines
  are those and the legacy routines are phased out.

* The band selection should be done by the driver, not by the net80211
  layer.

* ieee80211_lookup_channel_rxstats() only determines 11b or 11g channels
  for now - this is enough for scanning, but not 100% true in all cases.
  If we ever need to handle off-channel scan support for things like
  static-40MHz or static-80MHz, or turbo-G, or half/quarter rates,
  then we should extend this.

[1] This is a side effect of frequency-hopping and CCK modes - you
    can receive beacons when you think you're on a different channel.
    In particular, CCK (which is used by the low 11b rates, eg beacons!)
    is decodable from adjacent channels - just at a low SNR.
    FH is a side effect of having the hardware/firmware do the frequency
    hopping - it may pick up beacons transmitted from other FH networks
    that are in a different phase of hopping frequencies.

8 years agoUse ic_printf() instead of if_printf().
glebius [Mon, 25 May 2015 15:12:23 +0000 (15:12 +0000)]
Use ic_printf() instead of if_printf().

8 years agoStore softc in ic_softc and access it without using struct ifnet.
glebius [Mon, 25 May 2015 15:09:17 +0000 (15:09 +0000)]
Store softc in ic_softc and access it without using struct ifnet.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

8 years agoAdd void * member to struct ieee80211com, so that drivers can obtain their
glebius [Mon, 25 May 2015 15:08:38 +0000 (15:08 +0000)]
Add void * member to struct ieee80211com, so that drivers can obtain their
softc without going through the struct ifnet.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

8 years agoRemove unused include.
glebius [Mon, 25 May 2015 14:54:10 +0000 (14:54 +0000)]
Remove unused include.

8 years agoUse name from ieee80211com instead of parent ifnet, in debugging printfs.
glebius [Mon, 25 May 2015 14:30:44 +0000 (14:30 +0000)]
Use name from ieee80211com instead of parent ifnet, in debugging printfs.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

8 years agoDon't compare array to NULL.
glebius [Mon, 25 May 2015 14:12:50 +0000 (14:12 +0000)]
Don't compare array to NULL.

Found by: clang

8 years agoMake net80211 drivers supply their device name to the net80211 layer, so
glebius [Mon, 25 May 2015 13:51:13 +0000 (13:51 +0000)]
Make net80211 drivers supply their device name to the net80211 layer, so
that the latter doesn't need to go through struct ifnet to get their name.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

8 years agoUpgrade our copy of clang and llvm to 3.6.1 release.
dim [Mon, 25 May 2015 13:43:03 +0000 (13:43 +0000)]
Upgrade our copy of clang and llvm to 3.6.1 release.

This release contains the following cherry-picked revisions from
upstream trunk:

  226124 226151 226164 226165 226166 226407 226408 226409 226652
  226905 226983 227084 227087 227089 227208 227209 227210 227211
  227212 227213 227214 227269 227430 227482 227503 227519 227574
  227822 227986 227987 227988 227989 227990 228037 228038 228039
  228040 228188 228189 228190 228273 228372 228373 228374 228403
  228765 228848 228918 229223 229225 229226 229227 229228 229230
  229234 229235 229236 229238 229239 229413 229507 229680 229750
  229751 229752 229911 230146 230147 230235 230253 230255 230469
  230500 230564 230603 230657 230742 230748 230956 231219 231237
  231245 231259 231280 231451 231563 231601 231658 231659 231662
  231984 231986 232046 232085 232142 232176 232179 232189 232382
  232386 232389 232425 232438 232443 232675 232786 232797 232943
  232957 233075 233080 233351 233353 233409 233410 233508 233584
  233819 233904 234629 234636 234891 234975 234977 235524 235641
  235662 235931 236099 236306 236307

Please note that from 3.5.0 onwards, clang and llvm require C++11
support to build; see UPDATING for more information.

8 years agozfs: fixes for a full stream received into an existing dataset
avg [Mon, 25 May 2015 11:56:57 +0000 (11:56 +0000)]
zfs: fixes for a full stream received into an existing dataset

- this should fail early unless the force flag is set
- if the force flag is set then any local modifications including
  snapshots should be undone

See: https://www.illumos.org/issues/5912
See: https://reviews.csiden.org/r/220/

Reviewed by: mahrens, Paul Dagnelie <pcd@delphix.com>
MFC after: 15 days
Sponsored by: ClusterHQ

8 years agodsl_dataset_promote_check: ensure that shared snaps do not become too long
avg [Mon, 25 May 2015 11:48:15 +0000 (11:48 +0000)]
dsl_dataset_promote_check: ensure that shared snaps do not become too long

... after they are transfered from the old origin to the new one.

See: https://www.illumos.org/issues/5909
See: https://reviews.csiden.org/r/219/

Reviewed by: mahrens
MFC after: 10 days
Sponsored by: ClusterHQ

8 years agoUnbreak build where WANT_GDB == "no', as libreadline is also used by ntpdc.
markm [Mon, 25 May 2015 10:51:40 +0000 (10:51 +0000)]
Unbreak build where WANT_GDB == "no', as libreadline is also used by ntpdc.

8 years agoxen: make sure xenpv bus is the last to attach
royger [Mon, 25 May 2015 09:47:16 +0000 (09:47 +0000)]
xen: make sure xenpv bus is the last to attach

This is needed so other buses have a chance of attaching a real ISA bus, if
none is found xenpv will attach it.

Sponsored by: Citrix Systems R&D

8 years agoRemove excess Giant acquisition around the dounmount() call.
kib [Mon, 25 May 2015 09:08:19 +0000 (09:08 +0000)]
Remove excess Giant acquisition around the dounmount() call.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agosfxge: add 7xxx NICs family support
arybchik [Mon, 25 May 2015 08:34:55 +0000 (08:34 +0000)]
sfxge: add 7xxx NICs family support

Support 7xxx adapters including firmware-assisted TSO and VLAN tagging:

  - Solarflare Flareon Ultra 7000 series 10/40G adapters:
    - Solarflare SFN7042Q QSFP+ Server Adapter
    - Solarflare SFN7142Q QSFP+ Server Adapter

  - Solarflare Flareon Ultra 7000 series 10G adapters:
    - Solarflare SFN7022F SFP+ Server Adapter
    - Solarflare SFN7122F SFP+ Server Adapter
    - Solarflare SFN7322F Precision Time Synchronization Server Adapter

  - Solarflare Flareon 7000 series 10G adapters:
    - Solarflare SFN7002F SFP+ Server Adapter

Support utilities to configure adapters and update firmware.

The work is done by Solarflare developers
(Andy Moreton, Andrew Lee and many others),
Artem V. Andreev <Artem.Andreev at oktetlabs.ru> and me.

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 weeks
Causually read by: gnn
Differential Revision: https://reviews.freebsd.org/D2618

8 years agoUse the correct number of arguments for the
markj [Mon, 25 May 2015 01:31:39 +0000 (01:31 +0000)]
Use the correct number of arguments for the
opencrypto:deflate:deflate_global:bad DTrace probe, which is defined to
have

MFC after: 1 week

8 years agoRemove unused references to calltrap.
markj [Mon, 25 May 2015 01:22:56 +0000 (01:22 +0000)]
Remove unused references to calltrap.

MFC after: 3 days

8 years agolockstat(1): document the -V option.
markj [Mon, 25 May 2015 01:18:46 +0000 (01:18 +0000)]
lockstat(1): document the -V option.

MFC after: 3 days

8 years agoRemove a reference to the PBDRY flag, which itself was removed in r248470.
markj [Mon, 25 May 2015 01:09:18 +0000 (01:09 +0000)]
Remove a reference to the PBDRY flag, which itself was removed in r248470.

MFC after: 3 days

8 years agoFor objcopy, use --input-target and --output-target
rodrigc [Mon, 25 May 2015 01:07:55 +0000 (01:07 +0000)]
For objcopy, use --input-target and --output-target

When building with gcc 4.9 and binutils 2.25,
using '--input' and '--output' returns an error
message:
   objcopy: option `--input' is ambiguous

Reported by:  Jenkins

8 years agoRename fdt_find_child to ofw_bus_find_child. There is nothing FDT-specific
gonzo [Sun, 24 May 2015 23:53:10 +0000 (23:53 +0000)]
Rename fdt_find_child to ofw_bus_find_child. There is nothing FDT-specific
in this function.

Suggested by: andrew@

8 years agoRemove SUBDIR_DEPEND for non-existent libreadline directory
ngie [Sun, 24 May 2015 23:19:47 +0000 (23:19 +0000)]
Remove SUBDIR_DEPEND for non-existent libreadline directory

libreadline lives under gnu/lib

MFC after: 1 week

8 years agoLinux nanosleep() and clock_nanosleep() system calls always
dchagin [Sun, 24 May 2015 18:14:38 +0000 (18:14 +0000)]
Linux nanosleep() and clock_nanosleep() system calls always
writes the remaining time into the structure pointed to by rmtp
unless rmtp is NULL. The value of *rmtp can then be used to call
nanosleep() again and complete the specified pause if the previous
call was interrupted.

Note. clock_nanosleep() with an absolute time value does not write
the remaining time.

While here fix whitespaces and typo in SDT_PROBE.

8 years agoConvert SCM_TIMESTAMP in recvmsg().
dchagin [Sun, 24 May 2015 18:13:21 +0000 (18:13 +0000)]
Convert SCM_TIMESTAMP in recvmsg().

8 years agoThe latest cp tool is trying to use the btrfs clone operation that is
dchagin [Sun, 24 May 2015 18:12:04 +0000 (18:12 +0000)]
The latest cp tool is trying to use the btrfs clone operation that is
implemented via ioctl interface. First of all return ENOTSUP for this
operation as a cp fallback to usual method in that case. Secondly, do
not print out the message about unimplemented operation.

8 years agoHide vfs.pfs.trace variable if it is not used.
dchagin [Sun, 24 May 2015 18:11:22 +0000 (18:11 +0000)]
Hide vfs.pfs.trace variable if it is not used.

8 years agoFix an mbuf(9) leak in sendmsg() under failure condition and
dchagin [Sun, 24 May 2015 18:10:07 +0000 (18:10 +0000)]
Fix an mbuf(9) leak in sendmsg() under failure condition and
remove unneeded check for failed M_WAITOK allocation.

Found by: Brainy Code Scanner
Reported by: Maxime Villard

8 years agoRegen for r283492.
dchagin [Sun, 24 May 2015 18:09:01 +0000 (18:09 +0000)]
Regen for r283492.

8 years agoImplement Linux specific syncfs() system call.
dchagin [Sun, 24 May 2015 18:08:01 +0000 (18:08 +0000)]
Implement Linux specific syncfs() system call.

8 years agoProperly check tv_nsec value. The tv_nsec field can also be one
dchagin [Sun, 24 May 2015 18:06:46 +0000 (18:06 +0000)]
Properly check tv_nsec value. The tv_nsec field can also be one
of the special value UTIME_NOW or UTIME_OMIT.

8 years agoSince FreeBSD supports SOCK_CLOEXEC & SOCK_NONBLOCK options
dchagin [Sun, 24 May 2015 18:06:12 +0000 (18:06 +0000)]
Since FreeBSD supports SOCK_CLOEXEC & SOCK_NONBLOCK options
remove its emulation via fcntl call from Linuxulator.

8 years agoRegen for r283488.
dchagin [Sun, 24 May 2015 18:05:21 +0000 (18:05 +0000)]
Regen for r283488.

8 years agoImplement recvmmsg() and sendmmsg() system calls.
dchagin [Sun, 24 May 2015 18:04:04 +0000 (18:04 +0000)]
Implement recvmmsg() and sendmmsg() system calls.

8 years agoReduce duplication between MD Linux code by moving msg related
dchagin [Sun, 24 May 2015 18:03:14 +0000 (18:03 +0000)]
Reduce duplication between MD Linux code by moving msg related
struct definitions out into the compat/linux/linux_socket.h

8 years agoRegen for r283484.
dchagin [Sun, 24 May 2015 18:02:17 +0000 (18:02 +0000)]
Regen for r283484.

8 years agoImplement epoll_pwait() system call.
dchagin [Sun, 24 May 2015 18:00:14 +0000 (18:00 +0000)]
Implement epoll_pwait() system call.

8 years agoConvert signal number to native for VT_SETMODE ioctl and remove
dchagin [Sun, 24 May 2015 17:59:17 +0000 (17:59 +0000)]
Convert signal number to native for VT_SETMODE ioctl and remove
strange and invalid ISSIGVALID macro.
The code has not been tested right way but it was originally broken.

8 years agoRegen for r283480.
dchagin [Sun, 24 May 2015 17:58:24 +0000 (17:58 +0000)]
Regen for r283480.

8 years agoAdd utimensat() system call.
dchagin [Sun, 24 May 2015 17:57:07 +0000 (17:57 +0000)]
Add utimensat() system call.

The patch developed by Jilles Tjoelker and Andrew Wilcox and
adopted for lemul branch by me.

8 years agoThe kernel sends signals to the processes via ABI specific sv_sendsig method.
dchagin [Sun, 24 May 2015 17:56:02 +0000 (17:56 +0000)]
The kernel sends signals to the processes via ABI specific sv_sendsig method.
Native ABI do not need signal conversion, only emulators may want this. Usually
emulators implements its own sv_sendsig method. For now only ibcs2 emulator does
not have own sv_sendsig implementation and depends on native sendsig() method.
So, remove any extra attempts to convert signal numbers from native sendsig()
methods except from i386 where ibsc2 is living.

8 years agoSimplify linprocfs_doprocenviron(). Remove extra proc visibility checks
dchagin [Sun, 24 May 2015 17:53:48 +0000 (17:53 +0000)]
Simplify linprocfs_doprocenviron(). Remove extra proc visibility checks
and initialize pn_vis by well known procfs_candebug().

8 years agoConvert Linux signal number to the FreeBSD.
dchagin [Sun, 24 May 2015 17:49:09 +0000 (17:49 +0000)]
Convert Linux signal number to the FreeBSD.

8 years agoConvert Linux sigsets before showing.
dchagin [Sun, 24 May 2015 17:48:34 +0000 (17:48 +0000)]
Convert Linux sigsets before showing.
Linux kernel displays sigset always as 16x4 bit mask.

8 years agoRework signal code to allow using it by other modules, like linprocfs:
dchagin [Sun, 24 May 2015 17:47:20 +0000 (17:47 +0000)]
Rework signal code to allow using it by other modules, like linprocfs:

1. Linux sigset always 64 bit on all platforms. In order to move Linux
sigset code to the linux_common module define it as 64 bit int. Move
Linux sigset manipulation routines to the MI path.

2. Move Linux signal number definitions to the MI path. In general, they
are the same on all platforms except for a few signals.

3. Map Linux RT signals to the FreeBSD RT signals and hide signal conversion
tables to avoid conversion errors.

4. Emulate Linux SIGPWR signal via FreeBSD SIGRTMIN signal which is outside
of allowed on Linux signal numbers.

PR: 197216

8 years agoAdd support for /proc/<pid>/auxv.
dchagin [Sun, 24 May 2015 17:46:04 +0000 (17:46 +0000)]
Add support for /proc/<pid>/auxv.

8 years agoAdd vdso and stack names to the /proc/self/maps.
dchagin [Sun, 24 May 2015 17:44:42 +0000 (17:44 +0000)]
Add vdso and stack names to the /proc/self/maps.

8 years agoAccording to Linux man sigaltstack(3) shall return EINVAL if the ss
dchagin [Sun, 24 May 2015 17:44:08 +0000 (17:44 +0000)]
According to Linux man sigaltstack(3) shall return EINVAL if the ss
argument is not a null pointer, and the ss_flags member pointed to by ss
contains flags other than SS_DISABLE. However, in fact, Linux also
allows SS_ONSTACK flag which is simply ignored.

For buggy apps (at least mono) ignore other than SS_DISABLE
flags as a Linux do.

While here move MI part of sigaltstack code to the appropriate place.

Reported by: abi at abinet dot ru

8 years agoAdd EPOLLERR flag handling to epoll.
dchagin [Sun, 24 May 2015 17:42:45 +0000 (17:42 +0000)]
Add EPOLLERR flag handling to epoll.

Tested by: abi at abinet dot ru

8 years agoAs fo_fill_kinfo() does not check fo_fill_kinfo to NULL
dchagin [Sun, 24 May 2015 17:40:14 +0000 (17:40 +0000)]
As fo_fill_kinfo() does not check fo_fill_kinfo to NULL
add a fo_fill_kinfo op to eventfdops.

Reported by: trinity

8 years agoRegen for r283467.
dchagin [Sun, 24 May 2015 17:39:18 +0000 (17:39 +0000)]
Regen for r283467.

8 years agoCall nosys in case when the incorrect syscall number is specified.
dchagin [Sun, 24 May 2015 17:38:02 +0000 (17:38 +0000)]
Call nosys in case when the incorrect syscall number is specified.

Reported by: trinity

8 years agoRegen for r283465.
dchagin [Sun, 24 May 2015 17:35:42 +0000 (17:35 +0000)]
Regen for r283465.

8 years agoAdd preliminary fallocate system call implementation
dchagin [Sun, 24 May 2015 17:33:21 +0000 (17:33 +0000)]
Add preliminary fallocate system call implementation
to emulate posix_fallocate() function.

Differential Revision: https://reviews.freebsd.org/D1523
Reviewed by: emaste

8 years agoDelete the duplicate of linux_to_native_clockid() function.
dchagin [Sun, 24 May 2015 17:30:31 +0000 (17:30 +0000)]
Delete the duplicate of linux_to_native_clockid() function.

Differential Revision: https://reviews.freebsd.org/D1521
Reviewed by: trasz

8 years agoDo not use struct l_timespec without conversion. While here move
dchagin [Sun, 24 May 2015 17:29:18 +0000 (17:29 +0000)]
Do not use struct l_timespec without conversion. While here move
args->timeout handling before acquiring the futex key at FUTEX_WAIT path.

Differential Revision: https://reviews.freebsd.org/D1520
Reviewed by: trasz

8 years agoAdd prototypes for static futex functions.
dchagin [Sun, 24 May 2015 17:27:59 +0000 (17:27 +0000)]
Add prototypes for static futex functions.

Differential Revision: https://reviews.freebsd.org/D1519
Reviewed by: trasz

8 years agoAs for now our tmpfs is no longer being considered
dchagin [Sun, 24 May 2015 17:26:58 +0000 (17:26 +0000)]
As for now our tmpfs is no longer being considered
"highly experimental" remove /dev/shm magic commited
in r218497 and convert tmpfs type to an expected magic number.

Differential Revision: https://reviews.freebsd.org/D1497
Reviewed by: emaste, trasz

8 years agoPrint out unsupported futex operation message only once for the process.
dchagin [Sun, 24 May 2015 17:25:57 +0000 (17:25 +0000)]
Print out unsupported futex operation message only once for the process.

Differential Revision: https://reviews.freebsd.org/D1498

8 years agoAdd some clock mappings used in glibc 2.20.
dchagin [Sun, 24 May 2015 17:23:08 +0000 (17:23 +0000)]
Add some clock mappings used in glibc 2.20.

Differential Revision: https://reviews.freebsd.org/D1465
Reviewd by: trasz

8 years agoImprove ktr(9) records in thread managment code.
dchagin [Sun, 24 May 2015 17:09:07 +0000 (17:09 +0000)]
Improve ktr(9) records in thread managment code.

Differential Revision: https://reviews.freebsd.org/D1464
Reviewed by: trasz

8 years agoUse local struct proc * varable instead of dereferencing td->td_proc.
dchagin [Sun, 24 May 2015 17:08:25 +0000 (17:08 +0000)]
Use local struct proc * varable instead of dereferencing td->td_proc.

Differential Revision: https://reviews.freebsd.org/D1463
Reviewed by: emaste

8 years agoAvoid unnecessary em zeroing in non-exec path
dchagin [Sun, 24 May 2015 17:07:10 +0000 (17:07 +0000)]
Avoid unnecessary em zeroing in non-exec path
as it already zeroed by malloc with M_ZERO flag
and move zeroing to the proper place in exec path.

Differential Revision: https://reviews.freebsd.org/D1462
Reviewed by: trasz

8 years agoRemove the unnecessary cast.
dchagin [Sun, 24 May 2015 17:05:59 +0000 (17:05 +0000)]
Remove the unnecessary cast.

Differential Revision: https://reviews.freebsd.org/D1461
Reviewed by: emaste

8 years agoRegen for r283451.
dchagin [Sun, 24 May 2015 17:00:43 +0000 (17:00 +0000)]
Regen for r283451.

8 years agoImplement ppoll() system call.
dchagin [Sun, 24 May 2015 16:59:25 +0000 (16:59 +0000)]
Implement ppoll() system call.

Differential Revision: https://reviews.freebsd.org/D1105
Reviewed by: trasz

8 years agotd_sigmask of a newly created thread copied from td.
dchagin [Sun, 24 May 2015 16:56:32 +0000 (16:56 +0000)]
td_sigmask of a newly created thread copied from td.
Remove excess initialization of td_sigmask.

Differential Revision: https://reviews.freebsd.org/D1128
Reviewed by: emaste

8 years agoUpdate Linux compat revision to 32.
dchagin [Sun, 24 May 2015 16:55:32 +0000 (16:55 +0000)]
Update Linux compat revision to 32.

Differential Revision: https://reviews.freebsd.org/D1122
Reviewed by: emaste

8 years agoConnect linux64 module to the build.
dchagin [Sun, 24 May 2015 16:53:32 +0000 (16:53 +0000)]
Connect linux64 module to the build.

Differential Revision: https://reviews.freebsd.org/D1097
Reviewed by: emaste