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=-0.8 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED 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 CE09BC00319 for ; Sat, 2 Mar 2019 04:31:32 +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 86A7020857 for ; Sat, 2 Mar 2019 04:31:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IAKWkbgb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 86A7020857 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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 1gzwJ3-00063Y-2V; Fri, 01 Mar 2019 23:31:25 -0500 Received: from mail-io1-xd44.google.com ([2607:f8b0:4864:20::d44]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1gzwJ1-00063J-KD for kernelnewbies@kernelnewbies.org; Fri, 01 Mar 2019 23:31:23 -0500 Received: by mail-io1-xd44.google.com with SMTP id y6so21297732ioq.10 for ; Fri, 01 Mar 2019 20:31:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:from:date:message-id:subject:to; bh=3qor20gLKt5GLWJYTRU44Eye2+mzViZYRV/66M1QyTw=; b=IAKWkbgb21xJZxj3+RkSs7Yd4XcL+3bGY0FKY2rfXHhIEFJkwX0UeBookmTIpk7SBI nm25dS67aGYBVklo8WF6FWO1AVbG6EybgzKvrKv2Tvqg3445U6RuHtbUe69DO/S8eBH6 riP1DM/PUzxtlyaZcE7BoJeGN/+vQ4Wwr2LM7oWuhj+q/9Ew3Yjrt8NhbztnOosLTj8q tmWQTLkiY+XV6dk/Y1RJhysDCLKPfQSV79q0+oX0jRbtJJZ5cL+RgXhGi6UVC8kWDwwy 30c292U23CPUIq0BqW6gCuhgdS6E/DgBcVeSrDAd1IN8o4YQPEJtldOzpFZ7PBf6goYe mISA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:from:date:message-id :subject:to; bh=3qor20gLKt5GLWJYTRU44Eye2+mzViZYRV/66M1QyTw=; b=SCT8x+FMRSG/W0b8t+B033BiogPH+HqR9j9zmIMF+hTK/WH0dI2RPCEGUrkVkATJrR sNbitc/wm0burdXzAbPogKez0wP1iwzsuyTF56cp6FVfV1AjJEq81fsmLTq65rLI8/OY UIN+sYT1JhrKB3Og7j23hUFQv6WBgLPi5XyN2ZlaPYfS/s5NH71XdN5l4XBs9PuWCq0C CVqpJUEexLxK9p1X/8aspOF760XWS4d7hSk8kp12kxQqP8tZgfqb2ok47yltEmjtZD0O SIW6tkSbHkEPiegK4bTEjayGO+PoGOYfERdNEHAKapkk4OZG1i0VtvyX56pBaIR/vPOf NssQ== X-Gm-Message-State: APjAAAWxhxk7dq+S/apfsPQVzlD7Bac7SBqz8DgqLq/uJB6vOxfGBlrs a1ljyfAHoZXmPcEO30ORZBr8igG0fZseCyzV+FqT/S6M X-Google-Smtp-Source: APXvYqy+6AfQCD8ArRHeX7IOFnY2WY3sh3zNIavoZFbZTnFWM4IQwVOT1RfosrJiousgxCpODcfvCsbOVQOsQkbRdOs= X-Received: by 2002:a5e:8513:: with SMTP id i19mr4614527ioj.21.1551501016174; Fri, 01 Mar 2019 20:30:16 -0800 (PST) MIME-Version: 1.0 From: Jeffrey Walton Date: Fri, 1 Mar 2019 23:29:53 -0500 Message-ID: Subject: How to make /dev/ttyACM0 (and friends) exclusive? To: 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: , Reply-To: noloader@gmail.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org Hi Everyone, I'm trying to trackdown a problem using my dialup modem. I have a program that opens the modem and watches caller id's. It flashes the hook when a telemarketer calls. It works well until... When another program opens the modem then my program starts reading intermittent responses intended for the other program. 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); I'm not sure if it because udev configures the device incorrectly or the kernel driver is configured incorrectly. Or maybe it is impossible to do. Does anyone know how I can make the device exclusive? Thanks in advance. _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies