From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 77D9546BBB for ; Tue, 4 Jul 2023 20:18:50 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BD15C68C637; Tue, 4 Jul 2023 23:18:47 +0300 (EEST) Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2C08768C5EB for ; Tue, 4 Jul 2023 23:18:42 +0300 (EEST) Received: by mail-ot1-f50.google.com with SMTP id 46e09a7af769-6b7541d885cso4771517a34.3 for ; Tue, 04 Jul 2023 13:18:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688501920; x=1691093920; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=dY9n7tEXnqPwFhJoSkZeKrA4RfpNp0iFx283IHcFc70=; b=iTrQ0RYJ70CNBsT2FvS8e0pfvat9Yrc6M5KA5+ffjeTQekxildfBcIVtRTn2m7peh8 LADvk/sxHzm5mUQLHtcgseRH0fb5p/HBOnxriM3lCpUVQ5HdITRnCopchVFC/7IFrnxw E1qNmeJydJYjFMPXs/UyZeW6S68UHuRb2qqDIbqHaai1LB07uJ4NBXNF/xKoPmpTr8Ba TilA41CVaV4LazGM9RH+bgP8cSxmg60VRcyQSBS6R3WlGFbUDX7GB6oQIZYhAWVW/o2/ PpYNaep3jXTq/S1vynBvqxh8Aiz//fzDfo8h4fW7lBpi9HZljoKOVW4tEyrG6dOlpaA+ GN0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688501920; x=1691093920; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dY9n7tEXnqPwFhJoSkZeKrA4RfpNp0iFx283IHcFc70=; b=Oe4/8SsvVmBEOF++pEmgzQATjQuskKZSFh+WYazP13xjVerJjZ6M593PABmhuRClmR nwQuWD5PfXvzMvby2HqoK0t0Ax9l/lp57a47cHdrzi3+rr6wkZrubRf6GezhfbMKBQJh spmF26WiartynciFXBZI0b+o4FuZxDh5P6SMOeVuUYEeO6coBdh9YyuH1DsX3GWCbtLO LYt7oBn7SCIj2gw9dSQh0NgbnUL3ECzx9g1Kbo2lOj1+JxOhdbICl9pVhb6dhvI+YJuC uMpeh6kbIKv9QvF5tDz9r6uq6RuqBoa3EgsnF+e0CBU0QfQHW7A/iaW3ftlxLVV/7NC9 +Z9Q== X-Gm-Message-State: AC+VfDxJZwUuUdy90C4gjbHobQKTJpXahGj4I9d17Dk9KwlWIebuAt3D rDKXkUlUWvwYtKbclh43nTwle0RX/iA= X-Google-Smtp-Source: ACHHUZ4o7EL6hLNmZJ41zt82qdGXFjchZRx0Cu7ugi8w3OQNivxDQO/qyQEh6eYeJ5KmL/iWY05nMQ== X-Received: by 2002:a4a:8c24:0:b0:565:84b0:845d with SMTP id u33-20020a4a8c24000000b0056584b0845dmr9171976ooj.6.1688501919898; Tue, 04 Jul 2023 13:18:39 -0700 (PDT) Received: from [192.168.0.12] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id j3-20020a4aab43000000b00560c9477e19sm1914843oon.7.2023.07.04.13.18.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 Jul 2023 13:18:39 -0700 (PDT) Message-ID: Date: Tue, 4 Jul 2023 17:18:40 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20230704185044.2154-1-jamrial@gmail.com> <5a79a98-acb9-62bc-5279-e3624fc3c5@passwd.hu> <78fb24a6-831e-e38e-1064-a9e316d8fea6@gmail.com> <168850077133.542.4969284195602855710@lain.khirnov.net> <015b4860-af67-5d23-2cd2-eac877d38df7@gmail.com> <168850164319.9711.14148902878362607430@lain.khirnov.net> From: James Almer In-Reply-To: <168850164319.9711.14148902878362607430@lain.khirnov.net> Subject: Re: [FFmpeg-devel] [PATCH 1/2] avutil/random_seed: add av_random() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 7/4/2023 5:14 PM, Anton Khirnov wrote: > Quoting James Almer (2023-07-04 22:08:40) >> On 7/4/2023 4:59 PM, Anton Khirnov wrote: >>>> >>>> Not if any of the functions above were called but failed to fill the buffer. >>>> >>>> I could add return AVERROR(ENOSYS) to the HAVE_UNISTD_H block, and >>>> return AVERROR_INVALIDDATA outside. >>> >>> AVERROR_INVALIDDATA is defined as 'Invalid data found when processing >>> input'. >>> This function does not process any input, so IMO that code never makes >>> sense for it. >>> >>> I'd say make it ENOSYS, AVERROR_UNKNOWN, or keep around one of >>> individual method errors. >> >> For the cases read() is used for /dev/random/, i can return >> AVERROR(errno), given the doxy states read() returns -1 on error and >> sets errno to some value. Although if it succeeds and returns a value >> smaller than len i would need to return AVERROR_UNKNOWN like you suggested. > > I wonder if we should be trying /dev/random at all. I cannot think of > any remotely sane configuration where /dev/urandom fails, but > /dev/random works. So it only makes sense to use /dev/urandom. I think the problem is that one may not generate the requested amount of bytes. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".