~ubuntu-branches/ubuntu/trusty/eglibc/trusty

« back to all changes in this revision

Viewing changes to sunrpc/svc.c

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2013-01-10 18:39:35 UTC
  • mfrom: (1.5.2) (4.4.24 experimental)
  • Revision ID: package-import@ubuntu.com-20130110183935-afsgfxkmg7wk5eaj
Tags: 2.17-0ubuntu1
* Merge with Debian, bringing in a new upstream and many small fixes:
  - patches/any/cvs-malloc-deadlock.diff: Dropped, merged upstream.
  - patches/ubuntu/lddebug-scopes.diff: Rebase for upstream changes.
  - patches/ubuntu/local-CVE-2012-3406.diff: Rebased against upstream.
  - patches/ubuntu/no-asm-mtune-i686.diff: Fixed in recent binutils.
* This upstream merge fixes a nasty hang in pulseaudio (LP: #1085342)
* Bump MIN_KERNEL_SUPPORTED to 2.6.32 on ARM, now that we no longer
  have to support shonky 2.6.31 kernels on imx51 babbage builders.
* Drop patches/ubuntu/local-disable-nscd-host-caching.diff, as these
  issues were apparently resolved upstream a while ago (LP: #613662)
* Fix the compiled-in bug URL to point to launchpad.net, not Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 * There are two sets of procedures here.  The xprt routines are
5
5
 * for handling transport handles.  The svc routines handle the
6
6
 * list of service routines.
 
7
 *  Copyright (C) 2002-2012 Free Software Foundation, Inc.
 
8
 *  This file is part of the GNU C Library.
 
9
 *  Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
10
 *
 
11
 *  The GNU C Library is free software; you can redistribute it and/or
 
12
 *  modify it under the terms of the GNU Lesser General Public
 
13
 *  License as published by the Free Software Foundation; either
 
14
 *  version 2.1 of the License, or (at your option) any later version.
 
15
 *
 
16
 *  The GNU C Library is distributed in the hope that it will be useful,
 
17
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
19
 *  Lesser General Public License for more details.
 
20
 *
 
21
 *  You should have received a copy of the GNU Lesser General Public
 
22
 *  License along with the GNU C Library; if not, see
 
23
 *  <http://www.gnu.org/licenses/>.
7
24
 *
8
25
 * Copyright (c) 2010, Oracle America, Inc.
9
26
 *
41
58
#include <rpc/svc.h>
42
59
#include <rpc/pmap_clnt.h>
43
60
#include <sys/poll.h>
 
61
#include <time.h>
44
62
 
45
63
#ifdef _RPC_THREAD_SAFE_
46
64
#define xports RPC_THREAD_VARIABLE(svc_xports_s)
544
562
}
545
563
libc_hidden_nolink_sunrpc (svc_getreq_common, GLIBC_2_2)
546
564
 
 
565
/* If there are no file descriptors available, then accept will fail.
 
566
   We want to delay here so the connection request can be dequeued;
 
567
   otherwise we can bounce between polling and accepting, never giving the
 
568
   request a chance to dequeue and eating an enormous amount of cpu time
 
569
   in svc_run if we're polling on many file descriptors.  */
 
570
void
 
571
__svc_accept_failed (void)
 
572
{
 
573
  if (errno == EMFILE)
 
574
    {
 
575
      struct timespec ts = { .tv_sec = 0, .tv_nsec = 50000000 };
 
576
      __nanosleep (&ts, NULL);
 
577
    }
 
578
}
 
579
 
547
580
#ifdef _RPC_THREAD_SAFE_
548
581
 
549
582
void