From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF84BC43381 for ; Wed, 6 Mar 2019 08:36:44 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 869D32064A for ; Wed, 6 Mar 2019 08:36:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 869D32064A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=vt.edu Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.91) (envelope-from ) id 1h1S2H-0005bL-EH; Wed, 06 Mar 2019 03:36:21 -0500 Received: from omr2.cc.ipv6.vt.edu ([2607:b400:92:8400:0:33:fb76:806e] helo=omr2.cc.vt.edu) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1h1S2F-0005bF-Jk for kernelnewbies@kernelnewbies.org; Wed, 06 Mar 2019 03:36:19 -0500 Received: from mr6.cc.vt.edu (mr6.cc.ipv6.vt.edu [IPv6:2607:b400:92:8500:0:af:2d00:4488]) by omr2.cc.vt.edu (8.14.4/8.14.4) with ESMTP id x268aEgN024296 for ; Wed, 6 Mar 2019 03:36:15 -0500 Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by mr6.cc.vt.edu (8.14.7/8.14.7) with ESMTP id x268a98j016371 for ; Wed, 6 Mar 2019 03:36:14 -0500 Received: by mail-qt1-f199.google.com with SMTP id r24so10830314qtj.13 for ; Wed, 06 Mar 2019 00:36:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :mime-version:date:message-id; bh=qDDTlsZ+fcFwBQLuWYKXYHOn36QxKHxE1GAW7jlpp68=; b=cFmnSCwMQ++Iw3UMMk509Dv7RKWlo/N09htoAjJ2AugSOf9soi2AvzNJ5hauqEVkY4 27wojHjwQTZxeDQ+Arv8FDbGj9dvrqGcz7z7l3kiffmP+Tj59yZzmR0Jrk846J1hMBBr DDB7NnOmUD35GjLptLOzhlwO8RSmPEsBjP42uCSO6W1q6Wn+2TIVHf3Mo9uCnEVphfxV Q+gtBNs2LvJO0wM4NigHcb2XY2+ztNMefLP0aOdukH770cStf0lqTsTOpTUVB4Ijcp0t CCAESHF23sieqqC4O61o8LOJQjz+dbx2OmnxbuX1ERoGP0VDqlxX78UYt8uSd+kw06Fl +Vew== X-Gm-Message-State: APjAAAUcXsRPbMAXoSuuOeGZDgVzfz9KwjnohkNxdzsUX2qXTnvAK8ql 2bfronOTsV92DETWwxIZbjT6m5R6y9Y4uB/u5RLubO3eOZ2JNcnT6EpPyrOC4z/97/pwjrKRp9W JJ5uUIdjiKNO0c3YMtn8+hON6+Obml8QT4cxiBv0= X-Received: by 2002:ac8:3513:: with SMTP id y19mr4862278qtb.49.1551861369543; Wed, 06 Mar 2019 00:36:09 -0800 (PST) X-Google-Smtp-Source: APXvYqz3p4uIrg1SbA4I0/zR6PHby8JquFFfGzhWzVBMeCsRbgRdPwi/aBv9Rbtz0fF8XzlGBsucFw== X-Received: by 2002:ac8:3513:: with SMTP id y19mr4862271qtb.49.1551861369356; Wed, 06 Mar 2019 00:36:09 -0800 (PST) Received: from turing-police ([2601:5c0:c001:4341::359]) by smtp.gmail.com with ESMTPSA id f7sm558421qtb.35.2019.03.06.00.36.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Mar 2019 00:36:08 -0800 (PST) From: valdis.kletnieks@vt.edu X-Google-Original-From: Valdis.Kletnieks@vt.edu X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev To: noloader@gmail.com Subject: Re: undefined reference to `ioctl_tty' In-reply-to: References: Mime-Version: 1.0 Date: Wed, 06 Mar 2019 03:36:07 -0500 Message-ID: <8142.1551861367@turing-police> Cc: kernelnewbies X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Wed, 06 Mar 2019 01:58:41 -0500, Jeffrey Walton said: > TIOCEXCL void > Put the terminal into exclusive mode. No further open(2) > operations on the terminal are permitted. (They fail with > EBUSY, except for a process with the CAP_SYS_ADMIN > capability.) Note that this is still slightly racy - if two processes both try to do an open and an ioctl, this can happen: Process 1 open() Process 2 open() Process 1 ioctl(TIOEXCL) Process 2 ioctl() But at this point, the second process has already succeeded in opening the device, so "no further opens" doesn't save you. Usually, this sort of race would be really hard to hit, especially if the ioctl() happens right after the open() - except that many systems will use cron or similar to launch stuff "once per hour" or similar. And they end up batching together two processes that each try to do this. Suddenly, it's a lot easier to hit that hole when cron launches two processes at 12:54:17 PM..... If there's one thing I've learned from almost 4 decades of sysadmin'ing on all sorts of systems, saying "Oh that timing hole is so tiny it won't ever get hit in production" guarantees that the Clock Gods will smite you for your hubris. :) _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies