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 689F8C43381 for ; Sat, 2 Mar 2019 18:47:38 +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 35E4720830 for ; Sat, 2 Mar 2019 18:47:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 35E4720830 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=archiver.kernel.org@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.91) (envelope-from ) id 1h09fd-0002Ur-88 for kernelnewbies@archiver.kernel.org; Sat, 02 Mar 2019 13:47:37 -0500 Received: from omr1.cc.ipv6.vt.edu ([2607:b400:92:8300:0:c6:2117:b0e] helo=omr1.cc.vt.edu) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1h09dt-0000FN-Fw for kernelnewbies@kernelnewbies.org; Sat, 02 Mar 2019 13:45:49 -0500 Received: from mr5.cc.vt.edu (mr5.cc.ipv6.vt.edu [IPv6:2607:b400:92:8400:0:72:232:758b]) by omr1.cc.vt.edu (8.14.4/8.14.4) with ESMTP id x22IjfRV018994 for ; Sat, 2 Mar 2019 13:45:42 -0500 Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mr5.cc.vt.edu (8.14.7/8.14.7) with ESMTP id x22Ijai3017075 for ; Sat, 2 Mar 2019 13:45:41 -0500 Received: by mail-qk1-f200.google.com with SMTP id s65so1124441qke.16 for ; Sat, 02 Mar 2019 10:45:41 -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=cSq+YiCo+r9nbjCrOJOO9dwizHnb73z8LEdQTiXnKRE=; b=Wgqoe5ppKJEetl0WEnAQ8oP5sw7JcoXrnGJb5ocqlMAbBoqZKoctqakpg0qsKAHEgH W9utk85zmvtFhMAFOURguNRtxo/Z0bsyC7FCDlGOXlm++VtAD9/tBjqoBa5qEp5H48AV Kg7aE2KgTGmAaAjnJkJF7hwG+U8iuPRJ//bWs38d8yWEDuU/OSjQjfjw2Jc3zEkwfZOW leUhGdyXPNzh5Nw9QX+BjfUd3ZdkELmYaXxHGtnCFCXt+PDbrtvxyPmTPtN7xvqLc+NO yFM4ng3uc5cP/A02VwyTk2VaEIGJxSbd0jq/0wCc5cRW7M6fpYYR2kQjiLAoZkhywU+2 RaaQ== X-Gm-Message-State: APjAAAWKwpNb8yoKQIGj5Ai/xe/ASpaA0pFnwYbn10utExE/Dmksmt50 +k6Sf41O5/IMwuKobwkCl7nys1ng/eCqD3B+GNLZNsATZxrg0oVTSl/bPd5wyc7ogYqu9OkpWMI AGgkQBWrFSflJtT9hFUHHWWYhGaoQ/Cp3gU0uBdU= X-Received: by 2002:ac8:37b0:: with SMTP id d45mr8727021qtc.87.1551552336089; Sat, 02 Mar 2019 10:45:36 -0800 (PST) X-Google-Smtp-Source: APXvYqwBUv50D7lyFmUrtxuFN2hlEjdhxEINqnBnoEdehfcKupCap6vxcDz2zU0DmgIwCfELQ7M+bw== X-Received: by 2002:ac8:37b0:: with SMTP id d45mr8727015qtc.87.1551552335866; Sat, 02 Mar 2019 10:45:35 -0800 (PST) Received: from turing-police ([2601:5c0:c001:4341::936]) by smtp.gmail.com with ESMTPSA id t55sm902600qtt.57.2019.03.02.10.45.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Mar 2019 10:45:34 -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: How to make /dev/ttyACM0 (and friends) exclusive? In-reply-to: References: Mime-Version: 1.0 Date: Sat, 02 Mar 2019 13:45:33 -0500 Message-ID: <3824.1551552333@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=archiver.kernel.org@kernelnewbies.org On Fri, 01 Mar 2019 23:29:53 -0500, Jeffrey Walton said: > I cannot seem to open the device in exclusive mode. The current open > is (I also tried with O_EXCL): > > int modem = open(device_path, O_RDWR | O_NOCTTY | O_SYNC); So what happens? Does the open fail? If so, what does perror() say about it? Or does the open work but the flag is ignored? Have you tried making the *other* program open it with O_EXCL so your caller-id program can't mess with its state? _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies