トップ «前の日記(2018-09-06) 最新 次の日記(2018-09-08)» 編集

ヨタの日々

2001|08|09|10|11|12|
2002|01|02|03|04|05|06|07|08|09|10|11|12|
2003|01|02|03|04|05|06|07|08|09|10|11|12|
2004|01|02|03|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|03|04|05|06|07|08|09|10|11|12|
2013|01|02|03|04|05|06|07|08|09|10|11|12|
2014|01|02|03|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|08|09|10|11|12|
2016|01|02|03|04|05|06|07|08|09|10|11|12|
2017|01|02|03|04|05|06|07|08|09|10|11|12|
2018|01|02|03|04|05|06|07|08|09|10|11|12|
2019|01|02|03|04|05|06|07|08|09|10|11|12|
2020|01|02|03|04|05|06|07|08|09|10|11|12|
2021|01|02|03|04|05|06|07|08|09|10|11|12|
2022|01|02|03|04|05|06|07|08|09|10|11|12|
2023|01|02|03|04|05|06|07|08|12|
2024|01|02|03|

2018-09-07 :-|

_

午前中は設計労。午後はパッケージング労をしました。

_ [OpenSSL][エラー][API]OpenSSL のエラー取得 API が bk すぎる

c - OpenSSL error handling - Stack Overflow

OpenSSL にはエラーを取得する API が 2 つある。

SSL_get_error は I/O 関連のエラーを取得する。ERR_get_error はそれ以外(SSL/TLS の暗号化処理に関するもの)。SSL_get_error と ERR_get_error で取得される値はことなる。値というか意味が異なる。

SSL_get_error マニュアルより

SSL_get_error() returns a result code (suitable for the C "switch" statement) for a preceding call to SSL_connect(), SSL_accept(), SSL_do_handshake(), SSL_read(), SSL_peek(), or SSL_write() on ssl. The value returned by that TLS/SSL I/O function must be passed to SSL_get_error() in parameter ret.

これら I/O API のエラーは SSL_get_error で取得しないといけない。ERR_get_error で取得しても 0 が返ってきます。

ERR_get_error マニュアルより

ERR_get_error() returns the earliest error code from the thread's error queue and removes the entry. This function can be called repeatedly until there are no more error codes to return.

SSL_get_error で不安なのがここ。

In addition to ssl and ret, SSL_get_error() inspects the current thread's OpenSSL error queue. Thus, SSL_get_error() must be used in the same thread that performed the TLS/SSL I/O operation, and no other OpenSSL function calls should appear in between. The current thread's error queue must be empty before the TLS/SSL I/O operation is attempted, or SSL_get_error() will not work reliably.

ようするにスレッドセーフじゃないと言っているんだが、それはそれとして、最後に「現在のスレッドで I/O 操作する前に必ずエラーキューを空っぽにしておけ」と言っている?どうやって?

_ [NetBSD]週刊? teck-kern

Kernel modules

カーネルモジュールの新しいフレームワークを作ったのでレビューよろしく、という話題です。「既存のコードが変更されるのはアカン」とツッコミが入ってます(APIとして互換性が無くなる)。

Patch: accept filters for NetBSD

FreeBSD の accept filter (accept_filter(9)) を移植するよ、という話題。#ifdef が多用されている、IPv4 だけ対応されている、などツッコミが入っています。

accept filter は accept() ではまだカーネルからユーザー空間へデータを返却せず(クライアントから connect() されただけの状態。つまり TCP ハンドシェイクが完了してもカーネルから返らない)データが到着してからカーネルからユーザー空間へ返すというもののようです。

NetBSD-8 kernel too big?

NetBSD 8 のカーネルのサイズがでかくないですか?という話題。/netbsd の .text セクションや .rodata などが拡張されてますよーという返答があります。

_ [ゆゆゆい]結城友奈は勇者である 花結のきらめき「おもてなし!讃州中学文化祭」後編

とりあえずハードまでさくっとコンプリート。

巫女たちの絵です。

文化祭の最優秀で貰えるうどん券に掛けたダジャレに子孫たちもドン引きである。

ぐんちゃんによる高嶋さん絵画が妙に迫力があって腹が痛い。